Documentation Home
MySQL and Windows
Related Documentation Download this Excerpt

MySQL and Windows  /  ...  /  MySQL Windows Forms Items

7.6.2 MySQL Windows Forms Items

This portion of the tutorial describes how to create a Windows Form with MySQL connectivity. The item template to use for this operation is named MySQL New Windows Form. To open the Add New Item window, right-click your windows form application and select MySQL from the list of installed items.

The item template for adding a new MySQL Windows Form is similar to the MySQL MVC item template (see Section 7.6.1, “MySQL ASP.NET MVC Items”), but with three major differences:

  • You can create the MySQL Entity Framework model under the root path of the project.

    Figure 7.39 A MySQL Entity Framework model created in a Windows Form Application

    A MySQL Entity Framework model created in a Windows Form Application

  • When selecting the desired entity, you can also select the layout type in which the new form will display the entity data.

    Figure 7.40 The "MySQL Windows Form" Item Template dialog, with the layout options

    The "MySQL Windows Form" Item Template dialog, with the layout options

  • A Resources folder is added to the project that contains images used by the icons for the generated form.

    Figure 7.41 The Resources Folder and New Form

    The Resources Folder and New Form

The new form will have all the necessary back-end code to display the entity data, with the user interface (UI) based on the previously selected layout.

Figure 7.42 The "frmactor" Form in Design Mode

The "frmactor" Form in Design Mode

Figure 7.43 The "frmactor" Form to Display Data

The "frmactor" Form to Display Data