.NET Teradata Driver in GAC

Connectivity
Fan

.NET Teradata Driver in GAC

Hi everybody,

I have installed the last .net teradata driver on my pc (WinXp Pro SP2) and I created a small testing application to test the drivers.
I use Visual Studio 2008.

That works fine on my pc since the installation package has registered some assemblies into the GAC.

I would like to know if is it possible to deploy my application on another pc without also installing the .net teradata driver into the GAC ?
Apparently, we use only the Teradata.Client.Provider.dll assembly.
So I would like to deploy this assembly in the bin folder on my application.

But I receive this error: "Unable to find the requested .Net Framework Data Provider. It may not be installed."

Is Somebody can tell me if it's mandatory to deploy the .net teradata driver into the GAC ?

Thanks in advance for your answer.
Jerome
9 REPLIES
Teradata Employee

Re: .NET Teradata Driver in GAC

1- Copy Teradata.Client.Provider.dll from InstallDir\Bin to your application directory.

2- Copy Teradata.Net.Security.Tdgss.dll from InstallDir\PrivateAssemblies to your application directory.

3- Use InstallUtil to register the provider. It will update the Machine.config file. All Data Providers are
registered in Machine.config file; otherwise ADO.NET Provider Factory cannot find the Assembly.
Or You must add "system.data" section to the Application Configuration file.

<system.data>
<DbProviderFactories>
<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=12.0.1.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c" />
</DbProviderFactories>
</system.data>
Fan

Re: .NET Teradata Driver in GAC

Hi Shaw,

It's perfect, it was I wanted.
That works fine.

Thanks for your solution, and thanks for the info about the provider registration (machine.config or system.data section).

Jerome

Re: .NET Teradata Driver in GAC



Great post Shaw, exactly what I was looking for.

Re: .NET Teradata Driver in GAC

I have the same issue, but td client is referenced in class library, which used in web application
I added the section to app.config and dll's are copied to bin folder
still the same error
Teradata Employee

Re: .NET Teradata Driver in GAC

I assume "web application" means ASP.NET application. Did you try web.config?
Fan

Re: .NET Teradata Driver in GAC

Sorry, I kind of new to this. I'm to copy the file C:\Program Files\Teradata\NET Data Provider for Teradata\13.10.00\bin\Teradata.Client.Provider.dll into my 'application folder'. Is the 'application folder' the folder my aspx page is in? If so, I've tried that and I'm still getting the same error.
Teradata Employee

Re: .NET Teradata Driver in GAC

At runtime CLR must be able to load Teradata.Client.Provider.dll and Teradata.Net.Security.Tdgss.dll assemblies. CLR hosted within ASP.NET will look for private assemblies in the BIN Directory.

1- Add a reference to the Teradata.Client.Provider.dll assembly to your project
2- Right-click Teradata.Client.Provider.dll reference and select Properties in Visual Studio.
3- Set the "Copy Local" property to True.
4- Repeat this procedure for Teradata.Net.Security.Tdgss.dll.

Visual Studio will copy the two assemblies to the BIN directory after the Build.
Fan

Re: .NET Teradata Driver in GAC

Thank you for your help and very good instructions. To be honest, I don't usually fiddle with the \bin directory, I only copy over my .aspx and .cs files over from my pc to production. But following your suggestion I copied all the files/folders over.

However, I still get the following error: "Unable to find the requested .Net Framework Data Provider. It may not be installed.".

If I add in the system.data section to web.config per your earlier suggestion, I get "Failed to find or load the registered .Net Framework Data Provider." I changed the version to '13.10.0.0', not sure what the publickey should be, hopefully the same.

There has to be a way I can access the database from my webpage without installing anything because I don't have access to the server itself, I can only upload files to 'my' directories.
Teradata Employee

Re: .NET Teradata Driver in GAC

Use Assembly.Load to debug "load" failures because Type.GetType(String) returns null in some cases

DataTable factories = DbProviderFactories.GetFactoryClasses();

foreach (DataRow row in factories.Rows)
{
Console.WriteLine("Name={0}, Invariant={1}, Assembly={2}\r\n",
row["Name"], row["InvariantName"], row["AssemblyQualifiedName"]);

if (row["InvariantName"].ToString().Equals("Teradata.Client.Provider", StringComparison.Ordinal))
{
String TypeName = (String) row["AssemblyQualifiedName"];

try
{
Assembly teradataAssembly = Assembly.Load(TypeName.Substring(TypeName.IndexOf(',') + 1));

Console.WriteLine(".NET Data Provider for Teradata Location = {0}\r\n",
teradataAssembly.Location);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}