Quantcast
Viewing all articles
Browse latest Browse all 445

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

Forums: 

Viewing all articles
Browse latest Browse all 445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>