string[] result = datatable.Rows.Cast<DataRow>().Select(row => row["COLUMN_NAME"].ToString()).ToArray();
if (Array.IndexOf(result, "colname") != -1)
{
int RowNo = Array.IndexOf(result, "colname");
result = result.Where((val, idx) => idx != RowNo).ToArray();
datatable.Rows[RowNo].Delete();
}
datatable.Acceptchanges();
if (Array.IndexOf(result, "colname") != -1)
{
int RowNo = Array.IndexOf(result, "colname");
result = result.Where((val, idx) => idx != RowNo).ToArray();
datatable.Rows[RowNo].Delete();
}
datatable.Acceptchanges();
No comments:
Post a Comment