Skip to main content

Data Source, Data Sets and Connections

Once you have created a new project in BID, you need to create a Data Source, a Data Set and a connection to the database.

To perform these tasks:

  1. Ensure that the Report Data window is visible.

    If not visible, select ViewReport Data from the Microsoft Visual Studio main menu.

  2. In the Report Data list, right-click on Data Sources and select Add Data Source.

    The Data Source Properties window opens.Figure 1176: Data Source Properties window

  3. Click the Edit button.

    The Connection Properties window opens.Figure 1177: Connection Properties window

  4. Click on the Server name down-arrow and select the name of the server to which you need to connect.

  5. Under Connect to a database, select the Select or enter a database name option.

  6. Click on the Select or enter a database name box down-arrow and select the database to which you need to connect.

  7. Click the Test Connection button to ensure that the connection works.

    A Test Results window displays.Figure 1178: Test Results window

  8. Click OK to close the message window.

    You are returned to the Connection Properties window. If the connection succeeded, continue to the next step. If the connection did not succeed, try selecting the server and/or database again, or select a different server and/or database.

  9. In the Connection Properties window, click OK to save your selections and close the window.

    You are returned to the Data Source Properties window.

  10. Make note of the 'Connection string' listed in the Data Source Properties window, as shown in the following figure.Figure 1179: Connection string

  11. In the Data Source Properties window, click OK.

    We now have a Data Source that will appear under Data Sources in the Report Data window. (In our example, our Data Source is named DataSource1).Figure 1180: Data Source in Report Data window

  12. Right-click on Datasets and select Add Dataset.

    The Dataset Properties window opens.Figure 1181: Dataset Properties window

  13. Under the 'Name' box, select the Use a dataset embedded in my report option.

  14. Click on the Data Source down-arrow and select the data source you created in the previous steps.

    In our example our Data Source is named 'DataSource1'.

  15. Under Query type, select the Stored Procedure option.

  16. In the Select or enter stored procedure name box, type or click the down-arrow to select, the stored procedure query to use.

    In our example, we used an 'SP_Meters' stored procedure that we had previously created.

  17. Click OK to save your selections and close the Database Properties window.

    The Dataset you just created is added to the Report Data window.Figure 1182: Dataset visible in Report Data window

    You are now ready to view your Dataset in the Report Data window.

  18. Select the newly created Dataset to view its Design pane, as shown in the following figure.Figure 1183: Dataset Design pane![](/img/docs/data-source-data-sets-connects_dataset-design-pane.png)