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=ropAddNum,
InspDate=:InspDate, Dob=ob,
SampDate=:SampDate \r\nWHERE DocumentId=ocumentId",
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?
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=ropAddNum,
InspDate=:InspDate, Dob=ob,
SampDate=:SampDate \r\nWHERE DocumentId=ocumentId",
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?