1

I added reference to MySql.Data.dll from mysql connector 6.9.10 installation. But still i get error: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) using c# in VS 2013

2
  • i have both using MySql.Data; and using MySql.Data.MySqlClient; stmts in my .cs file Commented Nov 2, 2017 at 19:29
  • can you show some code? Commented Nov 2, 2017 at 20:35

2 Answers 2

1

The problem was with the version incompatibility of .Net and Mysql i was using. My project is compiled with .net 3.5 and am trying to use Mysql.data dll from connector 6.9. Issue resolved after using dll from MySql connector 6.3.9/v2.0. Too bad that the error is misleading.

Sign up to request clarification or add additional context in comments.

Comments

0

On the *.cs file you are trying to use the MySql connector, you need a Using Statement.

Go to the line that you have the error on, the red squiggly. put the cursor on the word and press Ctrl . (period) You'll be presented with an option to add the using statement to the top of the file.

2 Comments

i have both using MySql.Data; and using MySql.Data.MySqlClient; stmts in my .cs file
the mySQL connector Version should be compatible with your VS version e.g. I was using VS 2012 and could not connect using MySQL connector 7 or above! So I down graded to v.6.3.9. This connector version works on all projects regardless of .NET version (within VS 2012).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.