shumaila

shumaila

  • NA
  • 1
  • 0

Urgent! Datatable sort does not work

Jun 5 2006 12:34 AM
Hi,
I am getting a dataset from database and then i am going through it to pick some rows. I am using those rows to create a datatable. After that i am trying to sort the data table on different fields.
here is the code
I am using a simple query here but the one i have is a much more complicated query.
DataTable DT = new DataTable();
Dataset DS = GetDataset("Select * from employees");
foreach(DataRow dr in ds.tables["table1"].rows)
{
if (calculation is valid)
DT.ImportRow(dr);
}

DT.sort = "[field1] asc";

I am then response.wrinting on the page but the dt is not sorted ? I don't know what is it that i am doing wrong. Please Help!
Shumaila

Answers (1)