0

I Created a DataAccess layer to connect any app with a mysql Database using Enterprise Library Data 5 for mysql, i used the dlls:

-EntLibContrib.Data.MySql.dll.enter code here -Microsoft.Practices.EnterpriseLibrary.Common.dll. -Microsoft.Practices.EnterpriseLibrary.Data.dll.

The version of each dll is 5.505.0.

i installed the full version of mysql server 5.5 with all the futures as developer machine. In my data access layer i had a method to call a stored procedure:

    public DataSet ExecuteDataSet(string sp_name, object[] parameters)
    {
        try
        {
            Database BD = new MySqlDatabase(_strCon);

            DbCommand cmd = BD.GetStoredProcCommand(sp_name, parameters);

            using (DataSet ds = BD.ExecuteDataSet(cmd))
                return ds;
        }
        catch (Exception e)
        {
            throw new Exception(e.Message);
        }
    }

I get an error in this line:

            Database BD = new MySqlDatabase(_strCon);

in my app config i have the connection string:

And the exception (FileNotFoundException) says:

Could not load file or assembly 'MySql.Data, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

2 Answers2

0

try to download the MySql.Data.dll from website http://dev.mysql.com/doc/refman/5.1/en/connector-net-ref.html

or from Nuget open the nuget console and type Install-Package MySql.Data

Sean
  • 2,990
  • 1
  • 21
  • 31
0

Assemply reference missing(MYSQL.data dll missing)

We have faced similar issues earlier..Checks to be done :

  • You should check in web.config the version you have given for DLL
  • MYsql.data dll version should match the version given in the DLL

You need to add reference(Dll) to the project if you havent done already.

Also you can check this Could not load file or assembly 'MySql.Data, Version=6.2.2.0

Check these and rebuild again.

Thanks

Community
  • 1
  • 1
Peru
  • 2,871
  • 5
  • 37
  • 66