EnterpriseLibrary.Data.NetCore(6.3.2) auto creates SqlDatabase class object instead of OleDatabase

37 Views Asked by At

This is my app.config

    <dataConfiguration defaultDatabase="DefaultConnectionString"/>
        <connectionStrings>
        <add name="DefaultConnectionString"
                 
             connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\asdas.accdb;Jet OLEDB:Database Password=dsfdsdsdsf;"
             providerName="System.Data.OleDb"/>
         </connectionStrings>
    </dataConfiguration>

this is my C# .NET 6.0 code

factory = new DatabaseProviderFactory();
                
if (string.IsNullOrEmpty(dbName))
{
    _db = factory.CreateDefault();
}
else
{
    _db = factory.Create(dbName);
}

For some reason, the _db that I create is of type Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase and not OleDatabase.

Do I miss any steps or settings?

0

There are 0 best solutions below