-2

So I am trying to create a Windows Forms application that accesses a MySql database, but trying to create a using directive for MySql created a "Type or namespace not found(using directive or assembly reference possibly missing)" error.

Screenshot of the issue

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325

1 Answers1

0

You likely don't have a reference to the MySql driver. You can install it using NuGet:

  1. Select Tools | NuGet Package Manager | Manage NuGet packages for the solution...
  2. Click Browse
  3. Type mysql in the search box.
  4. Select MySql.Data by Oracle
  5. Check the box next to your project on the right-hand side
  6. Click install
  7. Wait, agree to the licensing prompt

Once all is done, you should be able to add using statements without issue.

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86