c# - Sorting on Column of datatable as alphabetically..or filter column -


i want sort data of datatable, want sort on column2 alphabetically.

dataview dv = new dataview(dt); dv.sort = "column2 asc"; dt.defaultview.sort = "column2 asc"; 

dataview dv = yourdatatable.defaultview; dv.sort = "column2";                 yourdatatable = dv.totable(); 

you don't need add asc, it's default, unless want desc :) code worked me :)


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -