Sorting Datatable

S

scorpion53061

I have a datatable in which the adapter has not been updated (and I dont
intend to) and I want to stop after adding the rows to the datatable and
sort them by lets say the SLSM column DESC. Usually I would when calling
data sorted in a SQL server table would use a select statement but how would
I do this when all it is is a dataset with all the rows added?

If I have to I will update the data adapter and add all the rows to the
datatable but I would rather not do that if I do not have to.

Thanks for your help......

Me.Dshistory1.HISTORY.Rows.Add(drnew)'row

dshistory1.acceptchanges

End If

Loop

'now sort this dataset(datatable) as I get ready to do actions
 
W

William \(Bill\) Vaughn

Sure,
myDataSet.Tables("myTableName").DefaultView.Sort = "dateofbirth DESC"

hth
--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top