Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Data Sources Window

The Data Sources window displays the data sources in your project. You can use the Data Sources window to create a user interface (consisting of data-bound controls) by dragging items from the window onto forms in your project. Each item has a drop-down control list where you can select the type of control to create prior to dragging it onto a form. You can customize the control list with additional controls, including controls that you have created.

Data Sources Window

Using the Data Sources window, you can:

You display the Data Sources window by clicking Show Data Sources on the Data menu. The Data menu is only available when a project is open in Visual Studio.

You populate the Data Sources window by adding data sources to your project. To add new data sources with the Data Source Configuration Wizard, click Add New Data Source on the Data menu or click the Add New Data Source link in the Data Sources window.

You can also populate the window by adding DataSet items to your project using the Dataset Designer. For more information, see the "To create a dataset with the Dataset Designer" section of How to: Create a Typed Dataset.

You can drag an item from the Data Sources window onto a form to create a new data-bound control, or you can drag an item from the Data Sources window onto an existing control to set up the data binding between the control and the item dragged onto it. Each node in the Data Sources window allows you to choose the type of control that will be created when you drag it onto a form. You must choose between a Grid layout, where all columns or properties are displayed in a DataGridView, or a Details layout, where all columns or properties are displayed in individual controls. You can choose the control to be created prior to dragging by selecting an item in the Data Sources window and choosing the control from the item's drop-down control list.

Data Sources Window showing relation

The Data Sources window displays related tables in a hierarchical tree view. For example, in a dataset with Customers and Orders tables (where a customer can have many orders), the Orders table appears as the last column in the Customers table as an expandable node. To display data from this related table and set up the data binding to display the related orders for a selected customer, you would drag items from this related tree view (as opposed to items from the individual top-level nodes for Customers and Orders). For more information, see How to: Display Related Data in a Windows Application.

The following commands are available when you right-click the Data Sources window:

Add New Data Source

Opens the Data Source Configuration Wizard, which assists you in creating new data sources in your project.

Edit DataSet with Designer

Opens the selected dataset in the Dataset Designer. For more information, see How to: Edit a Dataset.

Configure DataSet with Wizard

Opens the Data Source Configuration Wizard populated with information from the selected data source.

Refresh

Synchronizes the Data Sources window with the data sources in your project.

The items in the Data Sources window are synchronized with your project, so removing an item from a project will be reflected in the Data Sources window. For example, if your project has a data source based on a Web service, removing the Web reference from your project also removes the Web service data source from the Data Sources window. For more information, see How to: Remove Data Sources from the Data Sources Window.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft