Skip to content

Sort a datatable

Mattias Nyqvist

Asked May 15, 2006, 4:40 AM EDT1 answer
Share
LinkedInX

Hi

I have a datatable that i would like to sort by a column (not the key column).

How should one sort a table?

Can the sorted table have the same name as se unsorted table?

I don't know now the the name of the current column (the column that should be the index for the sorted table, only the number of order ex. aRow[120]), will that be a problem?

Br
Matt

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • +1
    Hello
    You can sort the data Table as follows:

    DataTable.DefaultView.Sort = sortExpression + " " + sortOrder;

    Thank You
    Adnan Hasan
    +1