skip to the main content area of this page
Patterns and Practices

 

Enterprise Library 3.0 Configuration Tool Bug Creating Odbc and OleDb Connection Strings


There is a known bug in the Enterprise Library 3.0 Configuration Tool when building Odbc and OleDb Connection Strings. When you choose the ProviderName as System.Data.Odbc or System.Data.OleDb, the Data source is hard coded as .NET Framework Data Provider for Oracle (OracleClient) in the Connection Properties Wizard.

The workaround is not to use the wizard but instead just put the connection string directly in the Properties Grid.

 

Enteprise Library 3.0 Configuration Tool Bug

 

The brave can change the source code to alleviate the Copy/Paste Bug. Change ConnectionStringEditor.cs in the Data.Configuration.Design project.

The source code with the bug is as follows:

 

switch (providerName)
{
    case "System.Data.SqlClient":
        dataProvider = DataProvider.SqlDataProvider;
        break;
 
    case "System.Data.OracleClient":
        dataProvider = DataProvider.OracleDataProvider;
        break;
 
    case "System.Data.Odbc":
        dataProvider = DataProvider.OracleDataProvider;
        break;
 
    case "System.Data.OleDb":
        dataProvider = DataProvider.OracleDataProvider;
        break;
}

 

The last two case statments should be

 

case "System.Data.Odbc":
    dataProvider = DataProvider.OdbcDataProvider;
    break;

case "System.Data.OleDb":
    dataProvider = DataProvider.OleDBDataProvider;
    break;

 


Tags: EntLibConfigurationEditor


Topics



 

Popular Tags



Recent Links