开发者

Datatable select by row range c#

开发者 https://www.devze.com 2023-01-18 03:05 出处:网络
Does anyone know how to select datatable by row range? say if I need to pull out records in datatable from row #2开发者_如何转开发0 - #50.If you want to include rows 20 and 50, I think this will work:

Does anyone know how to select datatable by row range? say if I need to pull out records in datatable from row #2开发者_如何转开发0 - #50.


If you want to include rows 20 and 50, I think this will work:

var rows = (from r in table.AsEnumerable()
            select r).Skip(19).Take(31);

update:

or more succinctly:

var rows = table.AsEnumerable().Skip(19).Take(31);
0

精彩评论

暂无评论...
验证码 换一张
取 消