G
Guest
I have a dataset which am trying to sort by 3 specific columns. I am not
making any connection to the database to get the dataset. I have the raw
dataset already.
What i tried doing was to create a DataView and sort it by a column name.
mydataset.ReadXml(@sResponseXML);
DataView mydataview = new DataView();
mydataview = ds.Tables[0].DefaultView;
mydataview.Sort = "ColumnName";
Then I call a function Export() passing the dataset. The function loops thru
the dataset and writes the output as a csv file. So technically I cannot say
mydataview.Tables[0].Columns to loop thru the data view nor can I use the
foreach statement on a dataview.
I even tried sorting the dataset itself and passing it to the Export function
ds.Tables[0].DefaultView.Sort = "Country of Risk"; This doesnt work either.
Can someone give any ideas about how to handle this? I'd really appreciate.
Thanks
Deepa
making any connection to the database to get the dataset. I have the raw
dataset already.
What i tried doing was to create a DataView and sort it by a column name.
mydataset.ReadXml(@sResponseXML);
DataView mydataview = new DataView();
mydataview = ds.Tables[0].DefaultView;
mydataview.Sort = "ColumnName";
Then I call a function Export() passing the dataset. The function loops thru
the dataset and writes the output as a csv file. So technically I cannot say
mydataview.Tables[0].Columns to loop thru the data view nor can I use the
foreach statement on a dataview.
I even tried sorting the dataset itself and passing it to the Export function
ds.Tables[0].DefaultView.Sort = "Country of Risk"; This doesnt work either.
Can someone give any ideas about how to handle this? I'd really appreciate.
Thanks
Deepa