Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem connecting to Oracle using OLEDB for Oracle

Re: Problem connecting to Oracle using OLEDB for Oracle

From: Martin Weber <mweber_at_netbi.de>
Date: Wed, 11 May 2005 22:05:05 +0200
Message-ID: <42826571$0$292$4d4ebb8e@read.news.de.uu.net>


Hi Sunny,
this problem occurs in our application, using the Microsoft OLEDB driver too.
We have to use the original ORACLE OLEDB Driver. Maybe this causes your problem.

greetings
Martin

<sunny076_at_yahoo.com> schrieb im Newsbeitrag news:1115760088.177015.180540_at_o13g2000cwo.googlegroups.com...

Hi,

I am trying to connect to Oracle database using OLEDB for Oracle but I got error "ORA-01008: not all variables bound".

The following is my code:
string conString ="Provider=MSDAORA;"+

                        "Data Source=ORATEST.SOFTWARE-LABS.N­ET;User
ID=scott;Password=tiger";

using (OleDbConnection oledbConn = new OleDbConnection(conString)){

    oledbConn.Open();
    OleDbCommand cmd = new OleDbCommand("INSERT INTO \"TEST\" (\"TESTID\", \"TESTNAME\") VALUES (:TESTID,:TESTNAME)",oledbConn­);

    cmd.Parameters.Add( new
OleDbParameter("TESTID",System­.Data.OleDb.OleDbType.Integer)­);

    cmd.Parameters.Add( new
OleDbParameter("TESTNAME",Syst­em.Data.OleDb.OleDbType.VarCha­r));

    cmd.Parameters["TESTID"].Value = 12;     cmd.Parameters["TESTNAME"].Val­ue= "Test12";     try {

        cmd.ExecuteNonQuery();
    }catch(Exception e) {

}

Can anyone tell me what was wrong and how I can solve this problem?

Thank you in advance,

Sunny Received on Wed May 11 2005 - 15:05:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US