I have Datatable I want to compare the values and swap the rows original table1 PName CN CR DS prog 2.4 2.8 1.5 diff 1.7 0.5 2.2 new 1.2 2.1 1.7 "CN< 1.6 AND DS >1.5" then that ROW has to be moved to top output PName CN CR DS new 1.2 2.1 1.7 prog 2.4 2.8 1.5 diff 1.7 0.5 2.2
mydatatable.DefaultView.Sort = "pname asc";
DataRow[] rows1=mydatatable.Select("CN< 1.6 AND DS >1.5");
DataView dv = dt.DefaultView; dv.RowFilter = "CN < 1.6 AND DS > 1.5"; DataTable dt2 = dv.ToTable(); dv.RowFilter = "NOT(CN < 1.6 AND DS > 1.5)"; DataTable dt3 = dv.ToTable(); dt2.Merge(dt3); dt = dt2; dv = null; dt2 = dt3 = null;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)