Microsoft Enterprise Library Database Access Application Block for Adaptive Server

The Adaptive Server ADO.NET Data Provider 2.155 extends the Enterprise Library 4.1 Data Access Application Block (DAAB) to support Adaptive Server. DAAB is a collection of classes that simplifies common database functions such as creating database instances and updating database records. DAAB also encapsulates database-specific features, which allows for a database-agnostic application design.

DAAB for Adaptive Server classes are supported in Microsoft .NET Framework 3.5 and Microsoft Visual Studio 2008. To use DAAB for Adaptive Server, you need to update Microsoft Enterprise Library 4.1.

StepsUpdating Microsoft Enterprise Library 4.1

  1. Update DbProviderMapping.cs. After the line:

    public const string DefaultOracleProviderName =
       "System.Data.OracleClient";
    

    add:

    /// <summary>
    /// Default name for the Sybase managed provider.
    /// </summary>
    public const string DefaultSybaseProviderName = "Sybase.Data.AseClient";
    
  2. Add the following to DatabaseConfigurationView.cs:

    • After the line:

      using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
      

      add:

      using Microsoft.Practices.EnterpriseLibrary.Data.Sybase;
      using Sybase.Data.AseClient;
      
    • After the line:

      private static readonly DbProviderMapping defaultGenericMapping = new
         DbProviderMapping(DbProviderMapping.DefaultGenericProviderName,
         typeof(GenericDatabase));
      

      add:

      private static readonly DbProviderMapping defaultSybaseMapping = new
         DbProviderMapping(DbProviderMapping.DefaultSybaseProviderName,
         typeof(AseDatabase));
      
    • After the line:

      if (OracleClientFactory.Instance == providerFactory) 
         return defaultOracleMapping;
      

      add:

      if (AseClientFactory.Instance == providerFactory)
         return defaultSybaseMapping;
      
  3. Add these assembly references to the Enterprise Library DataAccessApplicationBlock\Data solution:

    Sybase.AdoNet2.AseClient.dll
    Sybase.EnterpriseLibrary.AseClient.dll
    
  4. Perform a complete rebuild of the Enterprise Library.

For information about the Enterprise Library Data Access Application Block, see the Microsoft Developer Network.