I am trying to update records from a DataGrid but I am getting the following error message:
Update requires valid UpdateCommand when passed DataRow collection with modified rows
Here is My code:
private void btnUpdate_Click(object sender, EventArgs e)
{
System.Data.DataTable dt = ds.Tables["tblImpi"];
this.impdg.BindingContext[dt].EndCurrentEdit();
this.dataAdapter.Update(dt);
MessageBox.Show("Update Successful");
}
Try this:
For understanding DataGrid Control