# Step 2: Connecting the Data to C1DataSource

## Content



In this step, you'll add a [C1DataSource](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.html) component to the form and connect it to the _Categories_ table of the data source.

1.  Drag a [C1DataSource](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.html) component from the Toolbox onto the form. This is a non-visual component, so it will appear on the tray below the form area rather than on the form itself.
2.  In the **Properties** window, set the [C1DataSource](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.html)'s [ContextType](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.ContextType.html) property to the available item in the drop-down list. It should be something similar to _AppName.NORTHWNDEntities_. 
	> type=note
	> **Note**: The [C1DataSource.ContextType](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.ContextType.html) Property accepts both **DbContext** and **ObjectContext** derived types, as its values.
3.  Click the **ellipsis** button next to the **ViewSourceCollection** property to open the **EntityViewSourceProperties Collection Editor**.
4.  Click **Add** and set the **EntitySetName** property to _Categories_.
    
    ![](https://cdn.mescius.io/document-site-files/images/94bcede7-c342-4bf9-97a8-95fb8706d41c/graphics/quickstartwinforms/entityviewsourceprops.png)
    
5.  Click **OK** to close the editor.
    
    With the database connected to [C1DataSource](/componentone/api/win/online-datasource/dotnet-framework-api/C1.Win.Data.Entity.4.8/C1.Win.Data.Entities.C1DataSource.html), all you need to do is add a grid to display the data.