In DataTable
I could sorting with
dataTable.DefaultView.Sort = "SortField DESC";
I'm getting a DataSet
from database, I was wondering could I do a sorting on the DataSet
like how I do it in DataTable
.
In DataTable
I could sorting with
dataTable.DefaultView.Sort = "SortField DESC";
I'm getting a DataSet
from database, I was wondering could I do a sorting on the DataSet
like how I do it in DataTable
.
For advanced sorting needs you might want to use LINQ like described here. Basically it allows creating a DataView from a LINQ query using the System.Data.DataTableExtensions.AsDataFiew extension method.
Alternatively if you are OK with (or maybe even prefer) using an IEnumerable you could use the System.Data.DataTableExtensions.AsEnumerable extension method. For example:
Access the
DataTable
from the theDataSet
as follows,Hope this helps.
you can still access the DataTable from the the data set as follows,
Hope this helps.
Try the following code.
http://msdn.microsoft.com/en-us/library/1ay5y4w0(v=vs.71).aspx
http://social.msdn.microsoft.com/Forums/nl/netfxbcl/thread/adbd95cd-49d1-483d-b2b2-4b696a66e9a6
From tha DataSet object, you can access all the DataTable to intract with.
Try this: