Problem in configuratation tool in 3.0

Topics: Enterprise Library Core
Apr 9, 2007 at 8:45 PM
I am trying to create a connectionstring for an Access database in the configuration tool. When I select either the 'System.data.oledb' or System.data.odbc' in the providername dropdown, the dropdown for connectionstring is always showing the one for Oracle. I can't change it. The 'Change' button is also always disabled.
Apr 10, 2007 at 4:59 PM
Thanks for the report - we'll investigate. In the meantime a workaround is to enter the connection string directly into the properties grid.

Tom
Apr 10, 2007 at 10:55 PM
This is indeed a bug - an embarassing copy and paste error :-S. We're really sorry this slipped through the cracks.

If you'd like to fix it in the source code version, open the file ConnectionStringEditor.cs in the Data.Configuration.Design project, and find the GetKnownDataSourceAndProviderForProviderName method. You should see the offending code immediately:

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;
}

These last two should be replaced as follows:
    case "System.Data.Odbc":
        dataProvider = DataProvider.OdbcDataProvider;
        break;
 
    case "System.Data.OleDb":
        dataProvider = DataProvider.OleDBDataProvider;
        break;

Thanks for pointing it out - if/when we have a patch or a maintenance release we'll try to incorporate it.

Tom