Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
visual studio 2012 (ultimate) with mysql c# beginner's "journey" part 1:

Hi, I've downloaded the MySQL community workbench... and I'm trying to create "my1stMySQLdbApp" but have this error

Error 1 The type 'MySql.Data.MySqlClient.MySqlConnection' exists in both
'c:\Program Files (x86)\MySQL\Connector NET 6.7.4\Assemblies\v2.0\MySql.Data.CF.dll'
and 'c:\Program Files (x86)\MySQL\Connector NET 6.7.4\Assemblies\v4.5\MySql.Data.dll'


...

the code I've used is

C#
try
{
    string myConnection = "datasource=localhost;port=3306;username=root;password=7777";
    MySqlConnection mySqlConnection = new MySqlConnection(MySqlConnection);
    MySqlDataAdapter myDataAdapter = new MySqlDataAdapter();
    //myDataAdapter
}


It was not a surprise, as when I finally found and added the add reference and selected (searched for) mysql and added (ticked) MySql.Data / MySql.Data.CF / MySql.Data.Entity, several were listed

http://i.imgur.com/udZXyOa.png[^]

<img href="http://i.imgur.com/udZXyOa.png">http://i.imgur.com/udZXyOa.png[^</img>]

Do I / Should I delete one of the assemblies? Contents of C:\Program Files (x86)\MySQL\Connector NET 6.7.4\Assemblies indicates 4 collections (RT, v2, v4, v4.5)

I'm very new to all this, and would like to know why this is happening (did I even need to install MySQL on my laptop? Already had a / some SQL services running, but not sure what they're for) and how to configure VS / MySQL to fix.

Many, many, many thanks for anyone that tries to help. Back to google-fu!
Updated 17-Sep-13 6:49am
v2
Comments
Sergey Alexandrovich Kryukov 17-Sep-13 16:22pm    
I suspect you add references incorrectly. Do you get them from GAC? how exactly?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900