Link to home
Start Free TrialLog in
Avatar of young_nacs
young_nacs

asked on

sort DataSet with multiple column names

Hi I have one data table and I have usercontrol to return dataset of data table.
Because I have multiple columns in the data table , I like to sort by
"column1(String), column2(String), column3(DateTime) DESC" , and then return dataset.

Here is my code.
//create disk data table already, diskDT
//ds.Tables.Add(diskDT); //assign to dataset as a return later
string sortstr = "PatientID,ShotDate,ShotProc,FileName DESC";
DataView dv = new DataView();
dv = diskDT.DefaultView;
dv.Sort = sortstr;
ds = dv.Table.DataSet;
return ds

However, data set shows the original and did not sort it out.
How can I get the sort result to dataset?

 
ASKER CERTIFIED SOLUTION
Avatar of vijay_a73
vijay_a73

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vijay_a73
vijay_a73

hey..

its return ds and not diskDT.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial