Hi, i have a TreeView that has the usual Parent > Child relationship.
I populate my Treeview by using a DataAdapter to fill a DataTable by running a Stored Proc.
This Stored Proc returns a list of IDs Ordered by their Title, so they will appear alphabetically. But when i insert the records into the DataTable it seems to order them by ID and lose their original ordering.
I know i can use the Sort method on the DataTable :
dRowColl = dTable.Select(selectSql,"Title");
but using this has slowed down my program immensely! Obviously as its doing a textual sort, its running about 5 times as slow.
My selectSql above is the usual "parentID=CurrentParent and childID <> CurrentParent" to select the Parent > Child relationships. What i really would like to do is to add an "ORDER BY" bit to the end but you cant do this can you?
Has anyone had similar problems or knows of a way to speed things up?
Many thanks..
I populate my Treeview by using a DataAdapter to fill a DataTable by running a Stored Proc.
This Stored Proc returns a list of IDs Ordered by their Title, so they will appear alphabetically. But when i insert the records into the DataTable it seems to order them by ID and lose their original ordering.
I know i can use the Sort method on the DataTable :
dRowColl = dTable.Select(selectSql,"Title");
but using this has slowed down my program immensely! Obviously as its doing a textual sort, its running about 5 times as slow.
My selectSql above is the usual "parentID=CurrentParent and childID <> CurrentParent" to select the Parent > Child relationships. What i really would like to do is to add an "ORDER BY" bit to the end but you cant do this can you?
Has anyone had similar problems or knows of a way to speed things up?
Many thanks..