All Forums Connectivity
ysrinu 44 posts Joined 04/07
24 Jun 2012
.NET Data Provider, Provider Factory, cannot create DataSource Enumerator

I have added reference to Teradata.Client.Provider (.NET Data Provider for Teradata, Runtime v2.0.50727) to my Visual Studio C# 2010 project
Now, i want to get list of all ODBC names for Teradata

I included the namespace for Teradata.Client.Provider

I want to see the list of all Teradata datasources defined in ODBC.
I have 3 ODBC DSN defined for Teradata. However the factor doesn't return any. Why?

string ProviderName = "Teradata.Client.Provider";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
DataTable dt = new DataTable();

 if (factory.CanCreateDataSourceEnumerator)
    DbDataSourceEnumerator dsenum = factory.CreateDataSourceEnumerator();
    dt = dsenum.GetDataSources();
    Console.WriteLine("None found");

Why isn't able to create DataSource Enumerator?


-srinivas yelamanchili

NetFx 346 posts Joined 09/06
25 Jun 2012

The .NET Data Provider for Teradata has nothing to do with ODBC or the ODBC Driver for Teradata.

You must use the Microsoft .NET Data Provider for ODBC if you want to use the ODBC Driver to connect to the Teradata Database. But note that  the Microsoft .NET Data Provider for ODBC does not enumerate the ODBC Data Sources (User or System).

You must sign in to leave a comment.