How do I update a modified row of my datagridview to the db?
i had tried a lot...
but nothing happened....
i asked this question 2 days before....
can any one help me....
tried following code: but...
private void showButton_Click(object sender, EventArgs e)
{
con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ETMS\\ETMS\\ETMS\\etms.accdb");
String query = "SELECT * FROM Categories";
da = new OleDbDataAdapter(query, con);
OleDbCommandBuilder cb = new OleDbCommandBuilder(da);
ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
con.Close();
}
private void UpdateButton_Click(object sender, EventArgs e)
{
da.Update(ds);
}
if i run the code
i am getting the following error
"update requires a valid update command when pressed datarow collection with modified rows"
Please help me...
thank you