Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
__________________________________________________________
SDR_CLK0[1]| SDR_WE_N[1]| SDR_DQM1[1]| SDR_D8[1]|
__________________________________________________________
1.58307004 1.581856966 1.580593944 1.582041979
1.571203947 1.568992019 1.566966057 1.570862055
1.565935016 1.564203978 1.56219399 1.56514895
1.574257016 1.571560979 1.568174958 1.572227001
1.587502003 1.589027047 1.583907008 1.586900949
1.577990055 1.579285026 1.574648023 1.580180049
1.578268051 1.574828982 1.572911024 1.577414989
1.576817989 1.57546401 1.571624041 1.572636008
1.57000196 1.568976045 1.569291949 1.569571018
1.581068039 1.57931304 1.577916026 1.57843101
1.573557019 1.568127036 1.569232941 1.571727037
1.560495973 1.560119033 1.559612989 1.559713006
1.580675006 1.579769015 1.576385975 1.57770896
1.56875205 1.565245986 1.568423033 1.567438006
1.575602055 1.572589993 1.572198987 1.570927978
1.579988003 1.574985981 1.576442003 1.576588988
1.573945045 1.570400953 1.569372058 1.56942904
1.568055987 1.564877033 1.563992977 1.566707015
1.575961947 1.575402021 1.572743058 1.574262977
1.57842195 1.577636003 1.577057004 1.577728987
Posted
Updated 3-Mar-14 23:59pm
v9

Try this

DataView dataview = ft.DefaultView;
dataview.Sort = "ColumName";
DataTable dt = dataview .ToTable();
 
Share this answer
 
Comments
FarhanShariff 4-Mar-14 6:00am    
how to use sort by not using column names.I mean there are 3000 column.column's names change
Amalraj Ramesh 4-Mar-14 6:05am    
Use like this

DataView dataview = dtright.DefaultView;
dataview.Sort = dtright.Columns[0].ColumnName;
DataTable dt = dataview.ToTable();
FarhanShariff 4-Mar-14 7:07am    
what does dtright.DefaultView stand for
Amalraj Ramesh 4-Mar-14 7:14am    
DataView dataview = ft.DefaultView;
dataview.Sort = ft.Columns[0].ColumnName;
DataTable dt = dataview .ToTable();
Amalraj Ramesh 4-Mar-14 7:42am    
dt.DefaultView.Sort = "ColumnName ASC/DESC";
You can use DataView.Sort[^] property.
Look at the example[^].
C#
// Create DataView
DataView view = new DataView(yourDataTable);

// Sort by Program column in ascending order
view.Sort = "Program ASC";

-KR
 
Share this answer
 
Comments
FarhanShariff 3-Mar-14 9:25am    
Will this sort the data in Memory
Krunal Rohit 3-Mar-14 9:27am    
Why would you want to sort it in the memory ? I mean of course it would, but only for the some time. Let's say if you're not posting back your page or refreshing.

-KR
Krunal Rohit 3-Mar-14 9:28am    
But if you want to use it for the further use, you can create clone of it.

-KR
FarhanShariff 4-Mar-14 5:10am    
http://www.codeproject.com/Questions/738436/Sorting-Columns-and-find-Standard-Deviation
Have you tried it ?
Try yourself then ask question if any problem you faced. ok.

Look the link for help:

http://stackoverflow.com/questions/9107916/sorting-rows-in-a-data-table[^]

Thanks!
 
Share this answer
 
For DataTable Try This

DataTable dt = cls.Getdata();
dt.DefaultView.Sort = "ColumnName ASC/DESC";
 
Share this answer
 
Comments
FarhanShariff 4-Mar-14 9:05am    
please be more general column names are not to be considered how to loop column one after the other

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