Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Teradata SQL Assistant 13 with Teradata .Net provider - response (3) by dhepec

$
0
0
Hi, I am try to create a DSN using C# code and trying to connect to Teradata, i am getting the following error   [.Net provider for teradata][115006] could not resolve datasource ="DSNNAME" to an IPaddress.     private const string ODBC_INI_REG_PATH = "SOFTWARE\\ODBC\\ODBC.INI\\";         private const string ODBCINST_INI_REG_PATH = "SOFTWARE\\ODBC\\ODBCINST.INI\\";               var datasourcesKey = Registry.LocalMachine.CreateSubKey(ODBC_INI_REG_PATH + "ODBC Data Sources");             if (datasourcesKey == null) throw new Exception("ODBC Registry key for datasources does not exist");             datasourcesKey.SetValue("DSNNAME", "TERADATA"); string driverName = "Teradata";             var driverKey = Registry.LocalMachine.CreateSubKey(ODBCINST_INI_REG_PATH + driverName);               string driverPath = driverKey.GetValue("Driver").ToString(); var dsnKey = Registry.LocalMachine.CreateSubKey(ODBC_INI_REG_PATH + dsnName);             if (dsnKey == null) throw new Exception("ODBC Registry key for DSN was not created");               dsnKey.SetValue("Description", "TEST DSN FOR TERADATA");             dsnKey.SetValue("Driver", driverPath);             dsnKey.SetValue("LastUser", Environment.UserName);             dsnKey.SetValue("Server", "XXX.XXX.com");             dsnKey.SetValue("Trusted_Connection", "YES"); string user_nam = System.Environment.UserName;   Teradata.Client.Provider.TdConnection Connection = null;                Connection = new TdConnection("Data Source=" + DSNNAME+ ";User ID=" + user_nam + ";IntegratedSecurity=True;");              Connection.Open(); After connection, i am getting the following error     [.Net provider for teradata][115006] could not resolve datasource ="DSNNAME" to an IPaddress.  

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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