Designing DataTables
Visual Studio provides design-time tools for creating and editing data tables (DataTable). For an overview of what a DataTable is, see Creating and Using DataTables.
The following topics explain how to create data tables, add them to typed datasets using the Dataset Designer, and create and edit the data columns (DataColumn) that define them.
Note |
|---|
| The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings. |
In This Section
- How to: Create DataTables
-
Provides the steps to create a new DataTable with the Dataset Designer.
- How to: Add Columns to a DataTable
-
Provides the steps to create a new DataColumn in an existing DataTable.
- How to: Set the Data Type of a DataColumn
-
Explains how to set or change the data type property of a DataColumn.
- How to: Change the Caption of a DataColumn
-
Explains how to set the caption of a DataColumn to either the column name or something else.
- How to: Create an Autonumber DataColumn
-
Provides details on setting a DataColumn to contain auto-generated numbers.
- How to: Set the Default Value of a DataColumn
-
Provides details for setting the initial value for a new DataColumn.
- How to: Restrict a Data Column to Contain Unique Values
-
Explains how to set a DataColumn so it cannot contain duplicate values.
- How to: Set a Data Column as the Primary Key
-
Explains how to set a DataColumn to be the primary key in a DataTable.
- How to: Handle Null Values in a DataColumn
-
Provides information on what a DataColumn should do when it contains a null value.
- How to: Create Data Columns that Display Expressions
-
Explains how to set a DataColumn to display a calculated value.
- Walkthrough: Creating a DataTable in the Dataset Designer
-
Provides step-by-step instructions for creating a DataTable and defining the DataColumns that make up its structure.
Reference
- DataSet
-
Represents an in-memory cache of data.
- DataTable
-
Represents one table of in-memory data.
- DataColumn
-
Represents the schema of a column in a DataTable.
- DataRelation
-
Represents a parent/child relationship between two DataTable objects.
Note