NTier Application Wizard

N-Tier Windows Forms Framework

Summary

The NTier Application Wizard can be used to create an application from a database schema complete with a main form, navigation bar, grid, data entry forms and lookup selection forms.

The NTier Application Wizard is not intended to create a complete application but rather a runnable application project that can be used as a starting point.

Description

To create an NTier Application from a database schema:

  1. Open Visual Studio and click Tools->NTier to load the NTier Designer.



    The NTier Designer tool window will appear.

  2. Click the NTier Application Wizard icon on the tool window:



  3. The application wizard pane will appear:



    Click the 'Database' tab or 'Next' to begin.

  4. Choose a database schema:



    Open a database schema by entering either:

    Database connection details
    Select 'Microsoft Sql Server [File]' or 'Microsoft Access' on the left pane.
    Enter connection details on the right pane.

    Database schema from the NTier project
    Select 'Db Schema' on the left pane, then choose a database schema from the drop down.

  5. Select the tables to include in the application:



  6. Configure the table entities for the application:



    A description of each field is listed below:

    Field Description
    Table Name The name of the database table.
    Class Name The name of the class to be generated (customizable).
    Property Name The name of the property to be generated (customizable).
    Property Type The c# type of the property.
    Control Type The control used to edit the field (customizable)
    • None - don't provide a control or column for the field
    • TextBox - use a text box control
    • DateTimePicker - use a date time picker (date time fields only)
    • LookupControl - use a lookup control to edit by entering a value, or from a lookup form
    • ComboBox - use a drop down control
    Descriptions (captions) One or more descriptions in order of length. A description of best fit is chosen for grid column headers as the column is resized. Captions may be entered in a different language in the entity editor after the application has been generated. (customizable)
    For LookupControl or ComboBox control types:

    Field Description
    Use Entity Collections Tick to use an entity collection when looking up a value at run time.
    Use Static List Class Tick to instantiate a .net list object when looking up a value at run time.
    Lookup Entity Type For Entity Collection lookup, enter the entity type to use.
    Value Member The name of the property on a lookup collection item that returns the value that will be written to the field when an item is selected at run time.
    Display Member The name of the property on a lookup collection item that returns the text to be shown in the lookup or combo box control at run time.
  7. Configure the forms and modules for the application:

    Form preview:



    Module preview:



    For each entity in the 'Entities' pane, tick or untick desired UI features in the 'Forms' pane.
    Click the 'Edit' button to the right of the preview pane items to show or hide fields.

  8. Configure code generation settings:



  9. Click 'Finish' at the bottom of the wizard to commence code generation:



  10. Open the newly generated project in Visual Studio:



and you're done!

To compile and run the project, press F5 from within Visual Studio.


Back to NTier Documentation