How to Connect MySQL Database to

In this tutorial, I will teach you how to connect MySQL Database to using Microsoft Visual Studio 2008. With this, you can establish a connection between MySQL Database and


Let’s begin:


1. Create a database in the MySQL and name it “dbconnect

2. Open Microsoft Visual Studio and create a new windows form application for C#. Then, drag a button and do the form just like this.


3. Double-click a button to fire the click event handler of it.

4. After that, do the following codes to established a connection between MySQL Database and in the method.

Note: Add “MySQL.Data.dll” as your refernce and put “using MySql.Data.MySqlClient; above the namespace to access MySQL library.

5. Press F5 on the keyboard to run your project.



This is a simple yet powerful method to do because without this, you can’t proceed to the process of CRUD.


Download Source Code

Project Name : How to Connect MySQL Database to
Project Platform :C#
Programming Language Used:C# Programming Language
Developer Name
IDE Tool (Recommended):Visual Studio 2019
Project Type :Desktop Application
Upload Date and Time:July 15, 2016 – 7:17 am

Leave a Comment