How to return datatable using Take() using C# -


i have function returns datatable, added code sort datatable using dataview , should return top 10 rows sorted dataview.

dataview dvdt = dtdata.defaultview; dvdt.sort = "value desc" var vlist = dvdt.totable().asenumerable().take(10); 

i want know how can make sure datatable return item. how convert "vlist" datatable?

i use: c# , .net 3.5 framework.

you can use datatableextensions.copytodatatable:

var table = vlist.copytodatatable(); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -