Also you should have the knowledge of MySQL localhost and its users privileges. Please see the process below.
How To Connect MySQL To Visual Studio
- Download and install all the pre-requistics items mentioned above. Note: Please note down the username & password of MySQL to use it Visual Studio.
- Open Visual Studio and Add a new project.
- Now go to solution explorer -> Click on References -> Add Reference
- Now Click on Browse and navigate through this location "C:\Program Files (x86)\MySQL\MySQL Connector Net 5.0.9\Binaries\.NET 2.0" and click on MySql.Data.dll file -> Click Add
- Now Add the following namespace to your newly created project. This namespace helps to use MySQL Data Instances - (using MySql.Data.MySqlClient)
- Please use the below code to connect to mysql and enter your queries as required.
- Enjoy!! and let me know if you have queries.