| Below code helps us to do sorting of data in dataset after fill data from database to dataset
// First we decalre dataset
DataSet ds=new DataSet();
//function to fill dataset
ds=objclass.filldatasetfunction();
//now declare dataset
DataView dtView = ds.Tables[0].DefaultView;
//apply sorting to datatable
dtView.Sort = "fname ASC";
//bind datatable to datagrid
DataGrid1.DataSource=dtView;
DataGrid1.DataBind(); | | |