user366312
user366312

Reputation: 17026

MySQL Connector is not working

I have downloaded and installed MySql Connector for .NET 6.10.7.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="assemblies" type="Simple.Framework.AssembliesConfigurationSection, Simple.Framework"/>
  </configSections>

    <connectionStrings>      
        <add name="PTSystemMySql"
            connectionString="Data Source=localhost;Database=PrescriptionTrackingSystem;User ID=root;Password=xyz;"
            providerName="MySql.Data.MySqlClient" />
    </connectionStrings>
</configuration>

But, I have two problems:

  1. MySql.Data.dll isn't showing up in the Visual Studio reference manager:

enter image description here

  1. I have manually added MySql.Data.dll:

enter image description here

But, I am still getting an error:

An unhandled exception of type 'System.Configuration.ConfigurationErrorsException' 
occurred in System.Data.dll

Additional information: Failed to find or load the registered .Net Framework 
Data Provider.`

Note. I am 100% sure that there is no problem with the source code. Coz, the source code is fully functional in case of MS Access and MS SQL Server.

Upvotes: 1

Views: 1530

Answers (1)

Matthieu Bippus
Matthieu Bippus

Reputation: 46

You seem to use an old version of .NET (your screenshot shown "Targeting: .NET Framework 2.0").

According to the documentation, connector version 6.10.7 required .Net 4.5.2 at least.

Upvotes: 3

Related Questions