|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
The Dataset Designer is a set of visual tools for creating and editing typed datasets and the individual items that make up datasets.
The Dataset Designer provides visual representations of the objects contained in typed datasets. You create and modify TableAdapters, TableAdapter Queries, DataTables, DataColumns, and DataRelations with the Dataset Designer.
To open the Dataset Designer, double-click a dataset in Solution Explorer, or right-click a dataset in the Data Sources window and click Edit DataSet with Designer. For more information, see How to: Open a Dataset in the Dataset Designer. Adding a new DataSet item with the Add New Item dialog box will open the Dataset Designer with an empty dataset ready for editing.
The Dataset Designer can be used to extend the functionality of a dataset. Double-click the design surface or right-click and choose View Code to create a partial class file where you can add code to the dataset that will not be changed or deleted by the designer. For information on extending the functionality of a TableAdapter, see How to: Extend the Functionality of a TableAdapter.
The following table lists the common tasks you can accomplish with the Dataset Designer.
Create a TableAdapter
Edit a TableAdapter
Create a TableAdapter query
Edit a TableAdapter query
Create a DataTable
Edit a DataTable
Create a DataColumn
Create a relationship between two DataTables
Extend the functionality of the dataset
Add validation to a data table's ColumnChanging event
Add validation to a data table's RowChanging event
You can create datasets by adding and editing the individual objects that make up a dataset. The following table provides an explanation of the different objects in the DataSet tab on the Toolbox that can be dragged onto the design surface:
Contains a collection of data commands and a data connection that are used to communicate with the underlying database and populate a data table. For more information, see TableAdapter Overview and How to: Create TableAdapters.
TableAdapter queries are strongly typed methods that execute SQL statements and stored procedures. Running a TableAdapter query populates a data table with data or performs other database tasks. For more information, see How to: Create TableAdapter Queries. Dragging a query onto a table adds the query to that table, whereas dragging a query onto an empty area of the Dataset Designer creates a global query. For more information, see How to: Add Global Queries to a Dataset.
Represents an in-memory collection of the rows returned from a database.
Represents a parent-child relationship between two DataTables. For more information, see Introduction to DataRelation Objects and Walkthrough: Creating a Relationship between Data Tables.