ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Modifying the ConnectionString
In This Topic
    Modifying the ConnectionString
    In This Topic

    To change the location of the C1NWind.mdb reference, you can edit the ConnectionString property of the OleDbConnection. Note that you can see Data Binding for more information about binding the grid.

    Complete the following steps:

    1. In the C1TrueDBGrid Tasks menu, select Add Project Data Source from the drop-down box next to Choose Data Source.
    2. The Data Source Configuration Wizard appears. Select Database on the Choose a Data Source type page and click Next.
    3. Click the New Connection button to create a new connection or choose one from the drop-down list.
    4. Click the Browse button to specify the location of the data and enter the correct login information. Click the Test Connection button to make sure that you have successfully connected to the database or server and click OK. The new string appears in the on the Choose your data connection page.
    5. Click the Next button to continue. A dialog box will appear asking if you would like to add the data file to your project and modify the connection string. Click No.
    6. Save the connection string in the application configuration file by checking the Yes, save the connection as box and entering a name. Click the Next button to continue.
    7. On the Choose your database object page, select the tables and fields that you would like in your dataset. Enter a name for your DataSet in the DataSet name box and click Finish to exit the wizard.

      A DataSet and a connection string are added to your project. Additionally, Visual Studio automatically creates the code to fill the DataSet.