Teradata .net provider for Visual Studio 2010(.Net 4.0)

Connectivity

Teradata .net provider for Visual Studio 2010(.Net 4.0)

I am converting my .Net application from visual studio 2005(.Net 3.0) to Visual Studio 2010(.Net 4.0).
I am using the Teradata .net provider version 13.0.0.1. My development machine is on 32-bit Windows 7

After converting my .net application into Visual Studio 2010(.Net 4.0), the Teradata .net provider doesn't seem to work with .Net 4.0

Does anyone know whether the latest version of Teradata .net provider (13.01.00.02) is supported in Visual Studio 2010(.Net 4.0)?

4 REPLIES
Teradata Employee

Re: Teradata .net provider for Visual Studio 2010(.Net 4.0)

Two separate issues:

1- Visual Studio 2010 Integration

2- .NET Framework 4.0 support

.NET Data Provider 13.0.0.1 does not automatically integrate with Visual Studio 2010. But it can be used in .NET Framework 4.0 applications to connect to Teradata database.

.NET Data Provider 13.1.0.2 does not automatically integrate with Visual Studio 2010.

Re: Teradata .net provider for Visual Studio 2010(.Net 4.0)

It works fine when using Teradata .net Data provider directly. The following codes work fine.
TdConnection connection = new TdConnection("Data Source=dbc;User Id=user1;Password=password1;");
connection.Open();
try
{
using (TdCommand command = new TdCommand("Select * from table1", connection))
{
TdDataReader reader = command.ExecuteReader();
}
}
finally
{
connection.Close();
}

However, I am building a generic component using DbProviderFactories. Here are the codes.
System.Data.Common.DbProviderFactory provider = System.Data.Common.DbProviderFactories.GetFactory("Teradata.Client.Provider");
System.Data.Common.DbConnection connection = provider.CreateConnection();
connection.ConnectionString = "Data Source=dbc;User Id=user1;Password=password1;";
connection.Open();
try
{
using (System.Data.Common.DbCommand command = provider.CreateCommand())
{
command.Connection = connection;
command.CommandText = "Select * from table1";
System.Data.Common.DbDataReader reader = command.ExecuteReader();
}
}
finally
{
connection.Close();
}
It throws the error "Unable to find the requested .Net Framework Data Provider. It may not be installed."

It only works if I set the target framework to ".Net Framework 3.5".
I could be because the current version of Teradata .net provider is based on ADO.net 2.0
ADO.net 4.0 will not return the provider when calling the method DbProviderFactories.GetFactory("Teradata.Client.Provider").

Any plan for the next version to integrate with VS 2010 with ADO.net 4.0 based?

Re: Teradata .net provider for Visual Studio 2010(.Net 4.0)

Hussey,
First, Teradata .NET provider only works with Visual Studio 2005 and 2008.
The order of installation is important. You MUST install Teradata .NET data provider AFTER installing visual studio and check the option say something "Integrate with Visual Studio 2008".
There should be "Teradata" showing in the list of data source type.
Teradata Employee

Re: Teradata .net provider for Visual Studio 2010(.Net 4.0)

DbProviderFactories reads configuration information from

1- Machine.Config
2- App.Config

.NET Data Provider Installation adds information to CLR 2.0 Machine.Config; open Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config and you will see an entry similar to:

add name=".NET Data Provider for Teradata" invariant="Teradata.Client.Provider"
description=".NET Framework Data Provider for Teradata" type="Teradata.Client.Provider.TdFactory, Teradata.Client.Provider, Version=13.1.0.2, Culture=neutral, PublicKeyToken=76b417ee2e04956c"

.NET Framework 4.0 (unlike .Net Framework 3.5 and 3.0) has a new CLR. CLR 4.0 has a separate Machine.Config in Windows\Microsoft.NET\Framework\v4.0.30319\Config directory. You can copy and past the entry for .NET Data Provider for Teradata from CLR 2.0 Machine.config to CLR 4.0 machine.config. Or you can add a System.data section (as shown above) to the App.config file.