How to rearrange my dataset value

Posted by Gg under ASP.NET on 7/10/2012 | Points: 10 | Views : 1032 | Status : [Member] | Replies : 4
Hi,

How to rearrange my dataset value in .net

Thanks,
gg.




Responses

Posted by: Ranjeet_8 on: 7/10/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this.

// Get the DefaultViewManager of a DataTable.

DataView Dview = DataTable1.DefaultView;


// Set sorting order.
Dview.Sort = "Name, ZipCode DESC";


Gg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gg on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Ranjeet

I want to arrange except ASC and DESC.

Please tell me how can we achieve.

Thanks,
gg.

Gg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muralidosscm on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
DataView dv = ds.DefaultView;
//strSortExp is you dataset table column name
dv.Sort = strSortExp + " asc";

GridView1.DataSource = dv;
GridView1.DataBind();

Regards
Muralidoss M

Gg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sumit.Bundiwal on: 7/10/2012 [Member] Starter | Points: 25

Up
0
Down
you can use dataview for arrange record in asc and desc order by any column .If you want to use another arragement then you have to write your logic as your arragement

sumit bundiwal

Gg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response