This content has been marked as final.
Show 1 reply
-
1. Re: Connecting to Teiid VDB using ODBC
rareddy Jul 10, 2013 4:09 PM (in response to teiiduser)Ramesh..
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() Conn.Open();
{
OdbcConnection Conn = new System.Data.Odbc.OdbcConnection("DSN=TeiidNetUser;UID=myuserid;PWD=mypwd");
OdbcCommand catCMD = new OdbcCommand("SELECT * FROM table1", Conn);
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!
Ramesh..