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

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input