Operation Oracle Database implementation problems with uploading pictures to blob type fields

Source: Internet
Author: User
Tags ole oracleconnection oracle database
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");





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.