G
Guest
Hi,
I have a DataGridView that displays data from one table from database. I
didn’t implement any my code, I just used wizard to do all the work with
DatagridView populating.
Visual Studio generated strong typed dataset and binding. And here is my
problem.
I try to update the database with the new (changes) values from DataGridView:
Settings generated by Visual Studio:
dataGridView1.DataSource = tblMyTableBindingSource;
dataSetLKS.DataSetName = “DataSetLKSâ€
tblMyTableBindingSource.DataMember = “tblMyTableâ€;
tblMyTableBindingSource.DataSource = dataSetLKS;
private void button_Cllick(…)
{
this.tblMyTableAdapter.Update(this.MyDataSetName.Tables[0]);
}
I get error message “Update requires a valid UpdateCommand when passed
DataRow collection with modified rows.â€
The one of auto generated Update methods is:
Public virtual int Update(DataSetLKS.tbl_StatusDataTable dataTable)
{
….
}
How should I correct the Update command?
Thanks,
Lubomir
I have a DataGridView that displays data from one table from database. I
didn’t implement any my code, I just used wizard to do all the work with
DatagridView populating.
Visual Studio generated strong typed dataset and binding. And here is my
problem.
I try to update the database with the new (changes) values from DataGridView:
Settings generated by Visual Studio:
dataGridView1.DataSource = tblMyTableBindingSource;
dataSetLKS.DataSetName = “DataSetLKSâ€
tblMyTableBindingSource.DataMember = “tblMyTableâ€;
tblMyTableBindingSource.DataSource = dataSetLKS;
private void button_Cllick(…)
{
this.tblMyTableAdapter.Update(this.MyDataSetName.Tables[0]);
}
I get error message “Update requires a valid UpdateCommand when passed
DataRow collection with modified rows.â€
The one of auto generated Update methods is:
Public virtual int Update(DataSetLKS.tbl_StatusDataTable dataTable)
{
….
}
How should I correct the Update command?
Thanks,
Lubomir