Problem with Adding a new Database origin in Visual Studio 2015

28 views Asked by At

Windows 11 Visual Studio 2015

I create a New Projet Windows Form Application with .NET Framework 2.0. Now I would like to add a new MS Access 2003 Database db.mdb to this project.

Now I click on Add Db origin and Select a data origin type window appears, so I choose Database and in the next window I choose Dataset. The next window is asking me which Connection String is used to connect to the Database. The comboBox is empty so I cannot choose among the Providers, and when I click on New connection the window disappears.

Probably the problem is in the machine.config which I am studying but with no success, and need a hint.

Here you find the info I can submit:

c:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\

machine.config

<connectionStrings>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

<system.data>
    <DbProviderFactories>
       <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
       <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
       <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
       <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    </DbProviderFactories>
</system.data>

I probably need to add the correct connection string and remove the one I do not use, and also add the correct DBProviderFactories that might not be in this list.

MS Access database 2003 needs Provider=Microsoft.Jet.OLEDB.4.0

Any hint will be greatly appreciated

0

There are 0 answers