M
marc.birkett
Hello.
I am attempting to update the changes from a DataSet back to the
database, i am however getting the following error:
"The DataAdapter.SelectCommand property needs to be initialized"
The code i am using is:
//generate command objects to update source
OleDbCommandBuilder objCentreCommands = new
OleDbCommandBuilder(oDA);
//update table
oConn.Open();
oDA.Update(ds,"tblCentre");
oConn.Close();
Where oDA is an OdbcDataAdapter, oConn is the connection and ds is the
dataset which are all publically available. The error occurs on the
"oDA.Update()" line.
I dont understand my error as when i fill the dataset on the page
onload event, i use the code:
oConn.Open();
oDA.SelectCommand = new OleDbCommand(sqlCentre, oConn);
oDA.Fill(ds, "tblCentre");
oConn.Close();
So why do i need to redeclare the SelectCommand property?
Thanks,
Marc
I am attempting to update the changes from a DataSet back to the
database, i am however getting the following error:
"The DataAdapter.SelectCommand property needs to be initialized"
The code i am using is:
//generate command objects to update source
OleDbCommandBuilder objCentreCommands = new
OleDbCommandBuilder(oDA);
//update table
oConn.Open();
oDA.Update(ds,"tblCentre");
oConn.Close();
Where oDA is an OdbcDataAdapter, oConn is the connection and ds is the
dataset which are all publically available. The error occurs on the
"oDA.Update()" line.
I dont understand my error as when i fill the dataset on the page
onload event, i use the code:
oConn.Open();
oDA.SelectCommand = new OleDbCommand(sqlCentre, oConn);
oDA.Fill(ds, "tblCentre");
oConn.Close();
So why do i need to redeclare the SelectCommand property?
Thanks,
Marc