user3421357
user3421357

Reputation: 37

C# and MySql.Data.MySqlClient

I created project/app on one computer where I had MySql.Data.MySqlClient. Now I want to change/run program on another computer where I also installed and again added MySql.Data.MySqlClient to project but when I try

using MySql.Data.MySqlClient;

I still get error that it cant find MySql.Data.MySqlClient. How to resolve this ?

Upvotes: 2

Views: 9320

Answers (4)

user3421357
user3421357

Reputation: 37

I checked paths and for some reason didnt work,perhaps I missed somthing. Solved it with Package Manager Console and Install-Package MySql.Data command. Now I have it Local,thanks for the tip Christian Mark

Upvotes: 0

Mark
Mark

Reputation: 8431

I have a similar application running with WPF (C#. Net) and MySQL with entity.

1st: You have to install MySQL Connector to your development PC, then add MySQL.Data.dll to your references.

2nd: You have to set the property of the MySQL.Data.dll Keep local = "True". Again, this is important since if you install your application to other computer, they need to install also the MySQL Connector. With this, they don't need to install it.

Upvotes: 5

Rashid
Rashid

Reputation: 293

you have to install mysql-connector-net and add reference in your project

check this link for mysql connector

Steps

Install mysql-connector-net

Right-click on References, select Add Reference.

Select .NET tab. Check what the text directly under the tabs says, example: "Filtered to: .NET Framework 4 Client Profile".

Click on the Browse tab.

Browse to the MySql folder and go on into the Assemblies folder, example: C:\Program Files (x86)\MySQL\Connector NET 6.8.3\Assemblies

Select the version folder

Add MySql.Data.dll

Upvotes: 0

MrWombat
MrWombat

Reputation: 649

Are you sure the reference is updated? Check the path to the library by right clicking on the Library under References (in the Solution Explorer) and see the Properties. There is a Path value that should be correct for you pc.

If it is not, try to remove the reference and add it again.

Upvotes: 0

Related Questions