Skip to content

Instantly share code, notes, and snippets.

@forcewake
Created May 29, 2013 09:35
Show Gist options
  • Save forcewake/5669131 to your computer and use it in GitHub Desktop.
Save forcewake/5669131 to your computer and use it in GitHub Desktop.
Delete rows from the table from dataset
if (oDs.Tables.Count > 1)
{
oDs.Tables[1].Rows.Cast<DataRow>()
.Where(r =>
r["first"].ToString() == "0" ||
r["second"].ToString() == "5" ||
r["third"].ToString() == "000")
.ToList()
.ForEach(row =>
{
row.Delete();
row.AcceptChanges();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment