Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem connecting to Oracle using OLEDB for Oracle
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.NET;UserID=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",System.Data.OleDb.OleDbType.VarChar));
cmd.Parameters["TESTID"].Value = 12; cmd.Parameters["TESTNAME"].Value= "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