Brad
Brad

Reputation: 21160

C# - How do I sort a DataTable by date

I have a datatable that has a date column, but I am stumped as to how to sort it by that column. Any suggestions?

Upvotes: 6

Views: 6987

Answers (1)

Andy Mikula
Andy Mikula

Reputation: 16780

DataView view = DataTable.DefaultView;
view.Sort = "DateColumn";

Upvotes: 17

Related Questions