oracle| upload | upload pictures | data | database | Problems by using OLE DB to operate an Oracle database and successfully implement a BLOB-type field on a picture, but sometimes the problem of ORA-01036 errors is queried by the error prompt illegal variable Name/number, I don't know who can explain the meaning of illegal variable name/number in detail.
Oracle Data Provider for. NET
Hi
I am using odp.net (Oracle Data Provider to. NET) in the My ASP.net application.
I have a table in the My Oracle database called "Equipmentgroup". When the page is loads for the "I retrieve All" the records from the table to a dataset and save it to viewstate. Later on any addition or modification are done into the dataset only in disconnected mode. Finally,when user clicks Update I call this function ' update ' which should do a batch update but instead it gives the foll Owing error:
"Ora-01036:illegal variable Name/number"
private void Update ()
{
OracleParameter Workparam;
OracleConnection cnn = new OracleConnection ("Data source=neeleshr; User Id=tmse; Password=tmse; ");
String sql = "INSERT into Equipmentgroup (Code, Description, LifeTime, Priamrylife, Grading, inflator, Extensionrate, Main Tenancefee) VALUES (: Code,:D escription,: LifeTime,:P riamrylife,: Grading,: Inflator,: Extensionrate, Maintenancefee) ";
OracleCommand cmd = new OracleCommand (SQL,CNN);
Cmd.commandtype = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter ();
Da. InsertCommand = cmd;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Code", oracletype.char,10, "code");
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Description", oracletype.varchar,50, "Description");
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("LifeTime", Oracletype.number);
Workparam.sourcecolumn = "LifeTime";
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Priamrylife", Oracletype.number);
Workparam.sourcecolumn = "Priamrylife";
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Grading", oracletype.char,10, "Grading");
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("inflator", oracletype.number);
Workparam.sourcecolumn = "inflator";
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Extensionrate", Oracletype.number);
Workparam.sourcecolumn = "Extensionrate";
Workparam.sourceversion = DataRowVersion.Current;
Workparam = da. INSERTCOMMAND.PARAMETERS.ADD ("Maintenancefee", Oracletype.number);
Workparam.sourcecolumn = "Maintenancefee";
Workparam.sourceversion = DataRowVersion.Current;
Try
{
Da. Update (ds, "Equipmentgroup");
}
catch (Exception e)
{
Message.Text = E.message;
}
}
Hi
I am the should add parameters with ":" included, like:
Workparam =
Da. INSERTCOMMAND.PARAMETERS.ADD (": Code", oracletype.char,10, "code");
OLE DB Data Provider for. NET
String sql = "INSERT into Equipmentgroup (Code, Description, LifeTime, Priamrylife, Grading, inflator, Extensionrate, Main Tenancefee) VALUES (?,?,?,?,?,?,?,?,) ";
Hi
I am the should add parameters with ":" included, like:
Workparam =
Da. INSERTCOMMAND.PARAMETERS.ADD (": Code", oracletype.char,10, "code");