Executing setup for both the Data Provider and the application may not be practical when deploying to end-user machines. Xcopy Deployment can be used to deploy an application to users' machines. To set up an application for Xcopy deployment the following must be performed:
This file must be copied to the "Xcopy" directory. The default installation directory where this file is located is:
<drive>\Program Files (x86)\Teradata\NET Data Provider for Teradata\<version>\bin
This file only needs to be copied if the application uses the Entity Framework and Entity Provider. The default installation directory where this file is located is:
<drive>\Program Files (x86)\Teradata\NET Data Provider for Teradata\<version>\PrivateAssemblies
This file is used by the Data Provider for encryption and security. It is contained in the same directory as the Entity Provider.
In addition to application specific data, the application configuration file contains data that is used by the Data and Entity Providers. Connection string attributes can be specified that will be used by the Data Provider when creating a connection. Entries must also be specified for the Entity Provider when views are used in an Entity Model.
The <add> entry is a child of the <DbProviderFactories> element. It must be specified if the application uses the Common Base classes (e.g. DbConnection and DbCommand).
If the application uses direct references to the Teradata.Client.Provider assembly (e.g. TdConnection and TdCommand) this element does not have to be specified.
Config file |
Copy Code |
---|---|
<system.data> <DbProviderFactories> <remove invariant="Teradata.Client.Provider"/> <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=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> </DbProviderFactories> </system.data> |
If an entry for the .NET Data Provider for Teradata already exists under <DbProviderFactories> in the client's Machine Configuration File it must be removed. The <remove> entry will remove any existing definition of the Data Provider.
The version number of the Data Provider specified in the Version attribute must also be updated with the version number of the corresponding Data Provider that will be used by the application.
Refer to Obtaining a DbProviderFactory for more information.
The <SectionGroup> and <Section> associated with the Data and Entity Providers are discussed in Configuration Files.
The <remove> element will need to be specified if a <sectionGroup> associated with the .NET Data Provider for Teradata exists in the client's Machine Configuration File.
Config File |
Copy Code |
---|---|
<configSections> <remove name="teradata.client"/> <sectionGroup name="teradata.client" type="Teradata.Client.Provider.TdClientSectionGroup, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"> <section name="entity" type="Teradata.Client.Provider.TdClientEntitySection, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> <section name="provider" type="Teradata.Client.Provider.TdClientProviderSection, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> </sectionGroup> </configSections> |
The two <section> elements point to elements (<provider> and <entity>) related to the Data and Entity Providers. For more information on the <provider> element refer to Configuration File Provider Section. Information about the <entity> element is at Configuration File Entity Section
The following is an example of an application configuration file that contains elements that are needed by the Data and Entity Provider when using Xcopy Deployment.
application.configConfig File |
Copy Code |
---|---|
</configuration> <!-- Application specific information --> <configSections> <remove name="teradata.client"/> <sectionGroup name="teradata.client" type="Teradata.Client.Provider.TdClientSectionGroup, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"> <section name="entity" type="Teradata.Client.Provider.TdClientEntitySection, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> <section name="provider" type="Teradata.Client.Provider.TdClientProviderSection, Teradata.Client.Provider, Version=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> </sectionGroup> </configSections> <system.data> <DbProviderFactories>; <remove name="teradata.client"/> <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=15.10.0.0, Culture=neutral, PublicKeyToken=76b417ee2e04956c"/> </DbProviderFactories> </system.data> <teradata.client> <provider> <profiles> <add name="default" RecoveryTimeout="1201" RecoveryCommandTimeoutOverride="true" RecoveryStartInterval="2" ConnectMaxRetryCount="199" RecoveryIntervalFactor="1" RecoveryMaximumInterval="29"/> <add name="CustomProfile1" ConnectionTimeout="60" CommandTimeout="60" RecoveryTimeout="120" RecoveryCommandTimeoutOverride="false" RecoveryStartInterval="3000" ConnectMaxRetryCount="20" RecoveryIntervalFactor="10" RecoveryMaximumInterval="6000"/> </profiles> </provider> <entity> <storeSchemasList> <storeSchemas dataSource="teradata1"> <schema database="DbName" name="views" tableName="viewTableName"/> </storeSchemas> </storeSchemasList> </entity> </teradata.client> </configuration> |
Mapping Views and ViewColumns to Tables