Selecting the Database Connection

After you choose Generate C# Models from the popup menu, the Database Connection window appears and requires you to select the database (or the data source) which you have used to create the DataWindow object. You can select an existing database connection or create a new one if this is the first time you use C# Model Generator. The new database connection will be saved and become selectable when you open C# Model Generator next time.

To create a new database connection,

  1. Click the New Connection button in the Database Connection main window.

  2. In the window that follows, select a data source type and then specify the basic connection settings and/or the advanced settings (by clicking the Advanced button) for the selected data source type.

    The connection settings and the advanced settings are different according to the selected data source type.

  3. After specifying the connection settings and/or advanced settings, click Test Connection to verify the connection is successful and then click OK to close the window and return to the Database Connection main window.

    On the Database Connection main window, you can verify or change the connection string, and save the connection string in the configuration file.

    Once you click OK on the Database Connection main window, C# Model Generator tries to connect to the selected database.

If the DataWindow objects connect to more than one database, you can refer to Creating multiple database connections for how to create multiple database connections and parse the DataWindow objects.

C# Model Generator supports the following database types and versions:

  • PostgreSQL 11.3, 10.1, or 9.6

  • Oracle 12c or 18c

  • SQL Server 2016 or 2017

  • SQL Anywhere 16 (16.0.0.2043 or later) or 17