Connection string of Teradata for Asp.net

Connectivity
Enthusiast

Connection string of Teradata for Asp.net

  Hi,

    I want put teradata connection strng inside the web.config file and open it in .net code behind to access Teradat. I tried as belo

 <add name="TDCnnString" connectionString="DataSource=xxx.xxx.com;Initial Catalog=yyy; User ID=xxx; Password=xx123"/>

  And in code behind

 string sUser = ConfigurationManager.ConnectionStrings["TDCnnString"].ConnectionString;

        using (OdbcConnection cons = new OdbcConnection())

        {

          cons.ConnectionString = sUser;

          cons.Open();

        }

Also tried

string sUser = ConfigurationManager.ConnectionStrings["TDCnnString"].ConnectionString;

        using (TdConnection cons = new TdConnection())

        {

          cons.ConnectionString = sUser;

          cons.Open();

        }

But in both cases not able to open connection string. So what is the reason or should I need o change web.config connection string

Please guide me.

Thanks,

Mahendra

3 REPLIES
Enthusiast

Re: Connection string of Teradata for Asp.net

I am using .NET Data Provider 13.11.00.01 and Visual studio 2013

Teradata Employee

Re: Connection string of Teradata for Asp.net

Refer to the .NET Data Provider for Teradata documentation: 

https://developer.teradata.com/doc/connectivity/tdnetdp/14.11/webhelp/Teradata.Client.Provider~Terad...

Change "Initial Catalog" to "Database".

Re: Connection string of Teradata for Asp.net

This will help you... .Net Connection String

http://asp.net-informations.com/ado.net/asp-connection-string.htm

Robert