Donate

How To Sort DataTable In C# Or VB.NET

Sorting a data table before binding to a data control like gridview or datalist is provided by microsoft through it's predefined methods which is defaultview.sort.
Example:
  //C#  
  dt1.DefaultView.Sort = "Name Desc";  
  //VB.NET  
  dt1.DefaultView.Sort = "Name Desc" 
Where dt1 is your datatable. Or you could create a dataview object as provided by MSDN.
Source: MSDN

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Test Or Check Dead Pixels And Backlight Bleed On Your Monitor Using Dead Pixel Checker In Windows 11

How To Insert Or Add Emojis In Microsoft Teams Status Message