Udostępnij za pośrednictwem


Dataset Designer

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.

Note

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.

To

See

Create a TableAdapter

How to: Create TableAdapters

Edit a TableAdapter

How to: Edit TableAdapters

Create a TableAdapter query

How to: Create TableAdapter Queries

Edit a TableAdapter query

How to: Edit TableAdapter Queries

Create a DataTable

How to: Create DataTables

Edit a DataTable

Designing DataTables

Create a DataColumn

How to: Add Columns to a DataTable

Create a relationship between two DataTables

How to: Create DataRelations with the Dataset Designer

Extend the functionality of the dataset

How to: Extend the Functionality of a Dataset

Add validation to a data table's ColumnChanging event

How to: Validate Data During Column Changes

Add validation to a data table's RowChanging event

How to: Validate Data During Row Changes

Creating Objects on the Design Surface

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:

Object

Description

TableAdapter

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.

Query

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.

DataTable

Represents an in-memory collection of the rows returned from a database.

Relation (DataRelation)

Represents a parent-child relationship between two DataTables. For more information, see Introduction to DataRelation Objects and Walkthrough: Creating a Relationship between Data Tables.

LINQ to Dataset

LINQ to DataSet enables Language-Integrated Query (LINQ) over data in a DataSet object. For more information, see LINQ to DataSet.

See Also

Tasks

Walkthrough: Creating a Dataset with the Dataset Designer

Walkthrough: Creating a TableAdapter with Multiple Queries

Walkthrough: Creating a DataTable in the Dataset Designer

Walkthrough: Creating a Relationship between Data Tables

Walkthrough: Displaying Data on a Form in a Windows Application

Concepts

What's New in Data

Datasets in Visual Studio Overview

Reference

Data Sources Window

Other Resources

Preparing Your Application to Receive Data

Fetching Data into Your Application

Editing Data in Your Application

Validating Data

Saving Data