SqlConnection conn = new SqlConnection(connectionString); conn.Open(); SqlDataAdapter adapter = new SqlDataAdapter("select * from People", conn); SqlCommandBuilder cb = new SqlCommandBuilder(adapter); DataSet ds = new DataSet(); adapter.Fill(ds); DataRow[] rows_filtered = ds.Tables[0].Select("cityID=1"); foreach (DataRow item in rows_filtered) { item.Delete(); } dataGridView1.DataSource = ds.Tables[0]; //ds.Tables[0].AcceptChanges(); ***why this line causes trouble*** adapter.Update(ds.Tables[0]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)