2 Replies Latest reply: Aug 20, 2014 7:14 AM by bwladyga RSS

    Oracle.ManagedDataAccess

    bwladyga

       

      Hi

       

      I'm trying to get the Columns-Info.

      Sql-Statement:

      --select 1 id, '1 - DD[Demand Driven]' auswahl from dual

      --union

      select 2 id, '2 - TI[target Inventory]' auswahl from dual

      --union

      --select 3 id, '3 - RP[Reorder Point]' auswahl from dual

      --union

      --select 4 id, '4 - KB[Kanban] auswahl' from dual

       

      Instaled:

        Oracle.ManagedDataAccess, Version=4.121.1.0 (Release 12.1.0.1.0 for ODAC 12c Release 2)

        DB-Oracle :  11.2.0.3.0

       

      However I'm getting the following error in my test (64-Bit) Win 7 environment:

       

        System.IndexOutOfRangeException wurde nicht behandelt.    HResult=-2146233080

        Message=Der Index war außerhalb des Arraybereichs.

        Source=mscorlib

          StackTrace:

               bei System.String.get_Chars(Int32 index)

               bei OracleInternal.ServiceObjects.SQLParser.SqlGetNextToken(String sqlString, Int32 sqlStringLen, String& tokenString, Int32& pos)

               bei OracleInternal.ServiceObjects.SQLParser.SqlParse(String sqlStmt, List`1& sqlDataList)….

       

      Source Code:

       

      using System;

      using System.Data;

      using Oracle.ManagedDataAccess.Client;

      using System.Windows.Forms;

       

      namespace WindowsFormsApplication4

      {

        public partial class Form1 : Form

        {

          public Form1()

          {

            InitializeComponent();

          }

       

          private void button1_Click(object sender, EventArgs e)

          {

            DataTable ds = new DataTable();

            OracleConnection conn = new OracleConnection();

         conn.ConnectionString = "User Id=" + tusr.Text + ";Password=" + tpw.Text + ";Data Source=" + tdb.Text;

         conn.Open();

            OracleCommand cmd = new OracleCommand(rt1.Text, conn);

            OracleDataReader reader = cmd.ExecuteReader();

          ds = reader.GetSchemaTable();

            /*

      --select 1 id, '1 - DD[Demand Driven]' auswahl from dual

      --union

      select 2 id, '2 - TI[target Inventory]' auswahl from dual

      --union

      --select 3 id, '3 - RP[Reorder Point]' auswahl from dual

      --union

      --select 4 id, '4 - KB[Kanban] auswahl' from dual

              */

         conn.Dispose();

         }

        }

      }


      Please help. Thanks

      Boguslaw