ORA-01008: not all variables bound
Code: Select all
OracleConnection oc = new OracleConnection();
oc.Direct = true;
oc.Server = "server";
oc.Sid="sid";
oc.UserId="username";
oc.Password="password";
oc.Open();
OracleCommand ocmd = oc.CreateCommand();
ocmd.ParameterCheck = true;
ocmd.CommandText = "select :p1,:p1,:p2 from dual";
ocmd.Prepare();
ocmd.Parameters["p1"].Value = "00000";
ocmd.Parameters["p2"].Value = "00001";
OracleDataReader or = ocmd.ExecuteReader();
Seems to be related to the fact that there is a repeated parameter in the query.