Data Sources Window
The Data Sources window displays the data sources in your project. Data sources represent the data available to your application. You can use the Data Sources window to create data-bound controls in your user interface by dragging items from the window onto a design surface in your project.
The following illustration shows the Data Sources window. In this example, the window contains a typed dataset named NorthwindDataSet. Each item has a drop-down list that contains the controls you can create when you drag the item to a design surface.
Data Sources Window Tasks
The following table lists some of the tasks you can perform by using the Data Sources window.
Task |
More information |
---|---|
Open the Data Sources window. |
|
Create and add new data sources to your project. |
How to: Connect to Data in a Database |
Remove data sources from the Data Sources window. |
|
Create data-bound Windows Forms controls and WPF controls by dragging items from the Data Sources window onto a design surface. |
|
Choose which control should be created when you drag an item to a design surface. |
How to: Set the Control to be Created when Dragging from the Data Sources Window |
Customize the list of controls that is available for each data type in the Data Sources window. |
|
Open datasets for editing in the Dataset Designer. |
Populating the Data Sources Window
You populate the Data Sources window by adding data sources to your project. The Data Sources window can display data sources that are created from databases, services, or objects. For more information, see Data Sources Overview.
To add new data sources to your project, you can use the Data Source Configuration Wizard. For more information, see the following topics:
Creating Data-bound Controls
You can create a new data-bound control or you can add a data binding to an existing control. To create a new data-bound control, drag an item from the Data Sources window onto either the Windows Forms Designer or the WPF Designer. To set up data binding between an existing control and a data source, drag an item from the Data Sources window onto the existing control in the designer. For more information, see Binding Controls to Data in Visual Studio.
For each data type that appears in the Data Sources window, there is a default control that is created when you drag the item to the designer. If you want to create a different control, you can specify the control that will be created before you drag the item onto the designer. For more information, see How to: Set the Control to be Created when Dragging from the Data Sources Window.
Commands Available in the Data Sources Window
The following commands are available when you right-click an item in the Data Sources window.
Add New Data Source
Opens the Data Source Configuration Wizard, which helps you create new data sources in your project.Refresh
Synchronizes the Data Sources window with the data sources in your project.
The following additional commands are available when you right-click a dataset in the Data Sources window.
Edit DataSet with Designer
Opens the selected dataset in the Dataset Designer. For more information, see How to: Edit a Dataset.Configure Data Source with Wizard
Opens the Data Source Configuration Wizard so that you can modify the contents of the selected data source.Preview Data
Opens the Preview Data Dialog Box dialog box, which you can use to view the data returned by the TableAdapter queries in your dataset.
Removing Data Sources from the Data Sources Window
The items in the Data Sources window are synchronized with items in your project. If you delete an item from your project, that corresponding items will be removed from the Data Sources window.
For example, if your project has a data source based on a service, removing the service reference from your project also removes the service data source from the Data Sources window. For more information, see How to: Remove Data Sources from the Data Sources Window.
See Also
Tasks
How to: Set the Control to be Created when Dragging from the Data Sources Window
How to: Add Custom Controls to the Data Sources Window
Concepts
Binding Controls to Data in Visual Studio
Preparing Your Application to Receive Data