Designing DataTables
Visual Studio provides design-time tools for creating and editing data tables (DataTable). For an overview of what a DataTable is, see DataTables (ADO.NET).
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
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. 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.
Related Sections
DataTables (ADO.NET)
Describes how to create and customize DataTable objects.TableAdapters
Provides links to topics that explain how to create and edit TableAdapters with design time tools.Connecting to Data in Visual Studio
Provides links to topics that explain the different ways to connect to data in Visual Studio.Preparing Your Application to Receive Data
Provides links to topics explaining what datasets are, how to create new datasets, and how to create and edit the individual objects they are made of.Fetching Data into Your Application
Provides links to topics explaining how to execute queries and stored procedures, and load data into datasets.Binding Controls to Data in Visual Studio
Provides links to topics that explain how to display data on Windows Forms through databound controls.Editing Data in Your Application
Provides links to topics that explain working with the data in a dataset.Validating Data
Provides links to topics explaining where to put code to validate data.Saving Data
Provides links to topics explaining how to send updated data from an application to the database.