Farhan Shariff

Farhan Shariff

  • NA
  • 933
  • 237.3k

delete rows from DataTable based on comparing row values

Mar 28 2014 5:07 AM
CR CN
4.69517 4.559232
6.100273 4.942965
4.148316 4.039106
4.469541 4.339533
121.9486 121.2923
118.4546 117.8093
126.1222 125.5393
41.86481 42.70397
48.10417 48.88662



I have a datatable I want to delete rows if both (CR > 6 &&  CN > 6) I need to check both conditions and then delete

foreach( DataRow row in table1.Rows )
{
  if( /*  condition* / )
  row.Delete();
}

Answers (4)