datatable sort

R

reiks

I have a datatable . My requirement is to sort the table
rows in ascending and descending order basing on the
columns which I give it.

I've used the following expression

ds.Tables[0].DefaultView.Sort="au_fname";

but it's sorting in ascending order but not in descending.

How to specify the descending order.

also let me know how can I include multiple columns in my
above expression
 
B

Bin Song

A string containing the column name followed by "ASC"
(ascending) or "DESC" (descending). Columns are sorted
asending by default. Multiple columns can be separated by
commas.
ds.Tables[0].DefaultView.Sort="au_fname DESC";

Bin Song, MCP
 

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