How can I search rows in a datatable for a row with Col1=\"MyValue\"
I\'m thinking something like
Assert.IsTrue(dataSet.Tables[0].Rows.
FindAll(x =&g
You can use the Select
method of the data table to do this, or the Filter Property of the DefaultDataView
on the table.
For the Select
method:
var rows = dataSet.Tables[0].Select("Col1 = 'MyValue'");
For the DefaultView
Filter:
dataSet.Tables[0].DefaultView.Fitler = "Col1 = 'MyValue'";
foreach (var drv in dataSet.Tables[0].DefaultView)
{
// Do your processing
}