if (listRecords != null && listRecords.Count > 0) { foreach (string item in listRecords) { for (int i = 0; i < dataset.Tables[0].Rows.Count; i++) { if (item.Equals(dataset.Tables[0].Rows[i]["PersonID"], StringComparison.InvariantCultureIgnoreCase)) { dataset.Tables[0].Rows.Remove(dataset.Tables[0].Rows[i]); } } } } grid.DataSource = dataset.Tables[0].DefaultView;
DELETE FROM PERSONS WHERE PersonId = :PersonId
SELECT *...
SELECT * FROM Persons WHERE PersonID NOT IN (... list of unwanted IDs ...)
foreach
for
DataTable.DefaultView
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)