Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am having a dataset (Dataset ds) and below you can find demo fields and data of it.

Calendar DateUserIDVolume Processed
07/19/201211:30AM41212
07/18/201211:30PM4121
07/20/201201:30PM4128


The Column datatype is ,Calendar date as DateTime,UserID as Int and Volume Processed as Int.
I want to sort this Dataset by Calendar Date.I cant do the sorting from SQl because the Dataset is a merge of 2 Different Dataset.
Please help me that how i do the sorting in dataset.
Posted

 
Share this answer
 
Hi Dharmendra,

You can use dataView to sort data in a datatable, like:

DataView dv = new DataView(dt);
dv.Sort = "<colummn name=""> asc";
</colummn>



link below will help you:

How To Sort Datatable in c#.net[^]


Hope this helps.

Happy Coding :)
 
Share this answer
 
Comments
sandeep nagabhairava 19-Jul-12 7:09am    
good job sunny...
Sunny_Kumar_ 19-Jul-12 7:24am    
thank you.
C#
mydataset.Tables[index].Select("Calendar Date like '%'","Calendar Date asc")


try it.
Might be your solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900