0 Replies Latest reply: Aug 31, 2012 3:27 AM by 936666 RSS

    C# and ERROR [07001] [Oracle][ODBC][Ora]ORA-01008: not all variables bound

    936666
      Hi,
      I am Using odbc connection to connect the database

      using System.Data.Odbc;

      OdbcConnection con = new OdbcConnection();
      con.ConnectionString = "Dsn=MYDSN";
      OdbcCommand myCommand = con.CreateCommand();

      in the code i am creating the table and populating the data.
      I am able to create the table,where as i am not able to insert the data

      for (int i = 0; i < 2 ; i++)
      {
      myCommand.CommandText = "Insert into mytable (Col1,......)"
      myCommand.Prepare();

      myCommand.Parameters.AddWithValue("?", 0);
      myCommand.Parameters.AddWithValue("?", 0);
      .
      .

      myCommand.ExecuteNonQuery();
      myCommand.Parameters.Clear();
      }


      ERROR [07001] [Oracle][ODBC][Ora]ORA-01008: not all variables bound

      Where is the Problem.

      Thanks!