DataConnector | ComponentOne
In This Topic
    Visual Studio Integration
    In This Topic

    DataConnectors can be integrated with Visual Studio so that you can easily connect to online data sources such as Salesforce, Dynamics 365 Sales, OData, and Kintone through Server Explorer. With this integration, you can connect to these sources without writing a single line of code, drag and drop tables on a dataset in the designer, connect to data-aware controls like grids, charts & report designers such as Crystal Reports.

    To get DataConnectors integrated with Visual Studio automatically, you simply need to have the latest version of ComponentOne Control Panel on your system and install/update Data Services to the latest available version.

    Once the DataConnectors are integrated in Visual Studio, you can follow these steps to easily create database connection:

    1. Open your WinForms App in Visual Studio and from the View tab, select Server Explorer.
    2. In the Server Explorer, select Data Connections and click the Add Connection icon to connect to the database as shown in the following image.
      Visual Studio Server Explorer
    3. In the Choose Data Source dialog, choose a new data source and/or ADO.NET data provider and click OK. In this example, we choose C1 OData Data Source to connect to OData service.
      Note that the new provider might ask for credentials, depending on how you configured it.
      Choose Connection dialog
    4. In the Add Connection dialog, navigate to the ConnectionString property under Data, enter your connection string (without cache settings) and click Test Connection as shown in the following image. Note that the cache settings should be done in code or connection string in configuration file.
      Succesful Test Connection for creating data source
      Observe that the connection is successful.
    5. Click OK. Now, you can view the connected database as shown in the following image and create a new data source.
      Established connection with Odata service
    6. In the design view, drag and drop DataGridView control on the Form.
    7. Select the DataGridView control and click smart tag to open the C1DataGridView Tasks menu.
    8. Click the Choose Data Source drop down button and select Add Project Data Source... option to open the Data Source Configuration Wizard.
    9. On Choose a Data Source Type page, select Database and click Next.
    10. On Choose a Database Model page, select Dataset and click Next.
    11. On Choose Your Data Connection page, click Next as your data connection is already set as C1 OData [OData Sever V4].
    12. Save the connection string in the application configuration file by selecting the Yes, save the connection as check box.
    13. Click Next to switch to the Choose Your Database Objects page.
    14. Choose a table, say Customers from the Tables node and click Finish.

    The above steps add a dataset and binds the DataGridView control to the table you selected from the data source.