How do I create Windows form with mySQL?

Asked By 20 points N/A Posted on -
qa-featured

Hello,

I'm new to this. I want to create a Windows form data source from an Entity Data Model. I already have the database from MySQL and ODBC 5 connector. 

Can someone please teach me how to create Windows forms with MySQL? 

Thanks in advance.

SHARE
Answered By 30 points N/A #173194

How do I create Windows form with mySQL?

qa-featured

Hello

1. Go to your visual studio and select ( File> New > Project ) , choose (a windows form application) and hit ( ok ).

2. Adding an Entity Data Model :

Right click in solution explore and select (Add > New item ) and do as follows :

Adding an Entity Data Model

3. You will see a window choose as shown :

Generate from database empty model

4. Select (next) and you will see a window choose (next)

Application use to connect to the database

5. You see a window choose what you want in your model and then click (finish) 

Objects want to include in model

6. You will see the model as shown :

Microsoft Visual Studio Navigation Properties

7. From main menu select (Build > Build Solution ) 

8. To add a new data source :

In main menu select (Data > Add New Data source )

Choose a Data Source Type

9. Select Object and click next 

10. Make as shown and click Finish 

Select the object you wish to bind to

11. You will see your object as shown :

Microsoft Visual Studio Application 5

12. Using the data source in windows form :

In the data source panel selects data source and drag and drop it to your form 

Microsoft Visual Studio Form 1

13. Save and rebuild 

14. Adding code to make changes to the data grid view 

15. Save and rebuild 

16. Adding code to save changes to the database

In the Form designer click save icon 

Adding code to save changes to the database

I hope These steps will help you .

Login/Register to Answer

Related Questions