1

In the latest version of Simple.Data (1.0.0-beta2) I am using MySql as my database (version 5.5.2.1). I am using the latest MySql.Data assembly as a provider to connect to the database.

When I try opening a connection to my local MySql database in the following code, I get the exception "Multiple ADO Providers found; specify provider name or remove unwanted assemblies."

public class MyEntityRepository : IMyEntityRepository
{
    public MyEntity GetById(int id)
    {
        var db = Database.OpenConnection("Server=localhost;Port=3306;Database=myDatabase;Uid=root;Pwd=test; provider=MySql.Data");

        ...
    }
}

The only assemblies reference in my project/assembly are the following:

  • mysql.data
  • Simple.Data
  • Simple.Data.Ado
  • Simple.Data.MySql.Mysql40

Why is this error occuring?

contactmatt
  • 18,116
  • 40
  • 128
  • 186

1 Answers1

0

Do you have any other Simple.Data assemblies in the bin folder, perhaps left over from a previous reference?

Otherwise, try adding your connection to the connections section of the config specifying the providerName and name attributes; then use OpenNamedConnection.

Mark Rendle
  • 9,274
  • 1
  • 32
  • 58
  • I'm not getting an error when using Simple.Data with plain-old console application, but I just can't seem to get it working with my MVC web project. I'm going to do some more investigation tonight. – contactmatt Feb 29 '12 at 15:24
  • In my website project, I had a reference to the mysql data provider. However, i was also referencing a "persistance" project that itself had a reference to the mysql data provider as well. When removing the reference to the mysql provider from my website project, the issue seems fixed. – contactmatt Mar 10 '12 at 17:49