1. Create database in mysql with name “test” and create table with name “user”, like the below.
2. Create a new application project. In Visual Studio, on the menu click File> New > Project. For more details, see the following menu on the display.
3. Then will appear the window New Project like the look below.
4. Write down the name of the project that will be created on a field Name. Specify the directory storage project by accessing the field Location. Next, give the name of the solution in the Solution Name. Then click OK.
5. Then you will have created the framework of main program listings by Visual Studio. Here's how it looks.
6. Create a new windows form like the below
7. Create a new class for connection database and write the following program listing :
8. Next step, Back to windows form and view code to write the following program listing:
9. After you write down the program listings, press the F5 key to run the program and if you successfull connect your database the result is :