Hi,
There has been a doubt on DataTable.Select method.
I do not get an expected result when i query a datatable, if there is an 'AND' condition, i do not get a resultant data back into rows again.
The code i have done is
// clone to get the structure copied.
dtTopologyActive = dtTopologyDevices.Clone();
string strSelect = "DeviceId =" + int.Parse(strDevId) + " AND Feederstatus not in (" + strFeedStat + ")";
// drActiveDevices the datarow[]
drActiveDevices = dtTopologyDevices.Select(strSelect);
foreach (DataRow row in drActiveDevices)
{
dtTopologyActive.ImportRow(row);
}
// removing the rest of the entries for a particular device.
drAct = dtTopologyDevices.Select("DeviceId =" + int.Parse(strDevId));// AND Feederstatus in (" + strFeedStat + ")");
for (int i = 0; i < drAct.Length; i++)
{
dtTopologyDevices.Rows[i].Delete();
dtTopologyDevices.AcceptChanges();
}
// Adding the datarow (required) back to the main datatable.
foreach (DataRow row in dtTopologyActive.Rows)
{
dtTopologyDevices.ImportRow(row);
}