0

I have a dataset that i need to add into a dataset. I need to sort datatable before adding it into dataset.I can use DataView to sort the datatable but cannot figure out how to add this dataview into the dataset. Any ideas

DataView myDataView = MyDataTable.DefaultView;
myDataView.Sort = " Key1, Key2"
MyDataSet.Tables.Add(myDataView);   // no overload that takes a dataview

1 Answer 1

0

You can create a DataTable by calling DataView.ToTable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.