"ORA-01008: not all variables bound" OracleClient DataAdapter Update

R

ramsey

I am using OracleClient. I have a dataset, a DataAdapter, and a select
command. I fill the dataset using the dataadpter (and display it in a
datagridview). I'm a happy camper.

I create an update command using the following:

private System.Data.OracleClient.OracleCommand GetUpdateCommand()
{
System.Data.OracleClient.OracleCommand UpdateCmd = new
System.Data.OracleClient.OracleCommand(
"UPDATE tblDocuments SET \r\n\tPropAddNum=:propAddNum,
InspDate=:InspDate, Dob=:Dob,
SampDate=:SampDate \r\nWHERE DocumentId=:DocumentId",
oracleConnection1);
UpdateCmd.Parameters.Clear();
UpdateCmd.Parameters.Add("PropAddNum",
System.Data.OracleClient.OracleType.VarChar, 5);
UpdateCmd.Parameters.Add("InspDate",
System.Data.OracleClient.OracleType.DateTime);
UpdateCmd.Parameters.Add("Dob",
System.Data.OracleClient.OracleType.DateTime);
UpdateCmd.Parameters.Add("SampDate",
System.Data.OracleClient.OracleType.DateTime );
UpdateCmd.Parameters.Add("DocumentId",
System.Data.OracleClient.OracleType.Char, 8);
return UpdateCmd;
}

I alter one of the parameterized fields in thedata grid and try to invoke
the dataadapter's update and get "ORA-01008: not all variables bound" error.

I don't set a value for the parameters because, I reckon, that's what the
update method will do for each changed record.

I'm sure I'm doing somthing obviously ignorant, but I'm up a stump.

What am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top