I have a function that returns a datatable, I added a code that will sort the datatable using dataview and should return Top 10 rows from a sorted dataview.
DataView dvDt = dtData.DefaultView;
dvDt.Sort = "Value DESC"
var vlist = dvDt.ToTable().AsEnumerable().Take(10);
I want to know how can I make sure I get the datatable as return item. How to convert “vlist” to datatable?
I use: C# and .net 3.5 framework.
You can use
DataTableExtensions.CopyToDataTable: