Connecting To Teradata using ODBC in .NET

Connectivity

Connecting To Teradata using ODBC in .NET

I need to connect to teradata database using ODBC and passing the parameters within the .NET code.

I do not want to create a DSN for connecting and pass the parameters dynamically while connecting.

Thanks for any help
3 REPLIES
Teradata Employee

Re: Connecting To Teradata using ODBC in .NET

While it is possible to use the Teradata ODBC driver for a "DSN-less" connection, you can't control all the driver parameters via the ConnectionString. (See RunInQuietMode, for example.)

Why not use the .NET data provider? Or as a second choice, the OLE DB provider? Both can be found in the "downloads" section of Teradata.com
Teradata Employee

Re: Connecting To Teradata using ODBC in .NET


Look in ODBC Driver for Teradata User Guide http://www.info.teradata.com/eDownload.cfm?itemid=082330030

In Chapter 4->ODBC Connection Functions->keywords for SQLDriverConnect() and SQLBrowseConnect(),

there is a list of keywords you can use in connection-string. In-fact you can control every ODBC option thru these keywords.

Example :

DRIVER={Teradata};DBCNAME=myhost;UID=username;PWD=password;QUIETMODE=YES;

Teradata Employee

Re: Connecting To Teradata using ODBC in .NET

For a long time we have been able to set the options when invoking the ODBC API directly, but in the past there sometimes were issues with getting the intermediary Microsoft "Provider for ODBC" layer to pass everything along properly to the Teradata driver. There also used to be issues with passing the actual Teradata error code and message text through the intermediary provider back to the application.

I confess it has been a while since I last wrote an ODBC application, so thanks for your correction.