I have Dataset that include table Items, How can I sort this table by Code field ?
thank's in advance
With DataTable
, you usually sort a DataView
- for example:
DataTable table = dataSet.Tables["foo"];
DataView view = table.DefaultView;
view.Sort = "Code";
then work with view
.
DataSet fileTransferDetail = null; //Data to be sorted.
DataSet result = null; //Declare a dataSet to be filled.
// Sort data
fileTransferDetail.Tables[0].DefaultView.Sort = "ID DESC";
// Store in new Dataset
result.Tables.Add(fileTransferDetail.Tables[0].DefaultView.ToTable());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With