1 Reply Latest reply on Jul 10, 2013 4:09 PM by rareddy

    Connecting to Teiid VDB using ODBC

    teiiduser

      Hello,

       

      I am trying to connect to a VDB using C sharp.

      I followed http://docs.jboss.org/teiid/7.1.0.Final/client-developers-guide/en-US/html/ODBC.html

       

      and created a DSN. The connection test is successful. But when I try to connect programmatically, it throws an exception:

       

      ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

       

      This is my code:

       

      public void ConnectToData()
              {


                 OdbcConnection Conn = new System.Data.Odbc.OdbcConnection("DSN=TeiidNetUser;UID=myuserid;PWD=mypwd");
               OdbcCommand catCMD = new OdbcCommand("SELECT * FROM table1", Conn);

                 Conn.Open();

       

       

       

       

       

       

                 OdbcDataReader myReader = catCMD.ExecuteReader();

                  while (myReader.Read())
                  {
                      var table = myReader.GetSchemaTable();
                      foreach (DataColumn column in table.Columns)
                      {
                          Console.WriteLine(column.ColumnName);
                      }

       

                  }
                  }

      Any help is appreciated. Thank you!