.NET Data Provider, Provider Factory, cannot create DataSource Enumerator

Connectivity
Enthusiast

.NET Data Provider, Provider Factory, cannot create DataSource Enumerator

I have added reference to Teradata.Client.Provider (.NET Data Provider for Teradata 14.0.0.0, 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)
{
Console.WriteLine("found");
DbDataSourceEnumerator dsenum = factory.CreateDataSourceEnumerator();
dt = dsenum.GetDataSources();
}
else
{
Console.WriteLine("None found");
}

Why isn't able to create DataSource Enumerator?

Thanks,

-srinivas yelamanchili

1 REPLY
Teradata Employee

Re: .NET Data Provider, Provider Factory, cannot create DataSource Enumerator

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).