How to Sort datatable?

Hello !
I want to Sort datatable which has 10 columns.
Firstly i want to Sort datatable based on column “C” and that filtered data again should sorted based on column “E”

How can i do that ?

Hi @prabin_chand1 ,

Maybe you could try with the below Linq Expression :

DT = DT.AsEnumerable.OrderBy(Function(x)x("Your Column C Name").ToString).ThenBy(Function(x)x("Your Column E Name").ToString).CopyToDatatable

Here, DT is your Datatable input

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.