B
Boris Zakharin
I currently have a page which displays data in a DataGrid from a DataSet
filled by an OleDbDataAdapter. It also has buttons to carry out events which
should cause the grid contents to change (either a row is deleted or it is
changed so that the criteria of the select query no longer apply). However,
the grid does not change unless I explicitly reload the page using
Response.Redirect(Request.Url.AbsoluteUri) and I'm sure that could cause
unwanted side effects.
The current code is as follows:
oleDbConnection1.Open();
OleDbCommand cmdApp = new OleDbCommand("DELETE FROM jobs WHERE job_id =
?", oleDbConnection1);
cmdApp.Parameters.Add("job_id",
int.Parse(DataGrid1.DataKeys[e.Item.ItemIndex].ToString()));
cmdApp.ExecuteNonQuery();
oleDbConnection1.Close();
oleDbDataAdapter1.Fill(dsJobs21);
DataGrid1.DataBind();
Can anyone tell me what I'm doing wrong here?
Thanks,
Boris Zakharin
filled by an OleDbDataAdapter. It also has buttons to carry out events which
should cause the grid contents to change (either a row is deleted or it is
changed so that the criteria of the select query no longer apply). However,
the grid does not change unless I explicitly reload the page using
Response.Redirect(Request.Url.AbsoluteUri) and I'm sure that could cause
unwanted side effects.
The current code is as follows:
oleDbConnection1.Open();
OleDbCommand cmdApp = new OleDbCommand("DELETE FROM jobs WHERE job_id =
?", oleDbConnection1);
cmdApp.Parameters.Add("job_id",
int.Parse(DataGrid1.DataKeys[e.Item.ItemIndex].ToString()));
cmdApp.ExecuteNonQuery();
oleDbConnection1.Close();
oleDbDataAdapter1.Fill(dsJobs21);
DataGrid1.DataBind();
Can anyone tell me what I'm doing wrong here?
Thanks,
Boris Zakharin