Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
System.Data Namespace

Updated: November 2007

The System.Data namespace provides access to classes that represent the ADO.NET architecture. ADO.NET lets you build components that efficiently manage data from multiple data sources.

In a disconnected scenario such as the Internet, ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems. The ADO.NET architecture is also implemented in client applications, such as Windows Forms, or HTML pages created by ASP.NET.

The centerpiece of the ADO.NET architecture is the DataSet class. Each DataSet can contain multiple DataTable objects, with each DataTable containing data from a single data source, such as SQL Server.

Each DataTable contains a DataColumnCollection--a collection of DataColumn objects--that determines the schema of each DataTable. The DataType property determines the type of data held by the DataColumn. The ReadOnly and AllowDBNull properties let you further guarantee data integrity. The Expression property lets you construct calculated columns.

If a DataTable participates in a parent/child relationship with another DataTable, the relationship is constructed by adding a DataRelation to the DataRelationCollection of a DataSet object. When such a relation is added, a UniqueConstraint and a ForeignKeyConstraint are both created automatically, depending on the parameter settings for the constructor. The UniqueConstraint guarantees that values that are contained in a column are unique. The ForeignKeyConstraint determines what action will happen to the child row or column when a primary key value is changed or deleted.

Using the System.Data.SqlClient namespace (the.NET Framework Data Provider for SQL Server), the System.Data.Odbc namespace (the.NET Framework Data Provider for ODBC), the System.Data.OleDb namespace (the.NET Framework Data Provider for OLE DB), or the System.Data.OracleClient namespace (the .NET Framework Data Provider for Oracle), you can access a data source to use together with a DataSet. Each .NET Framework data provider has a corresponding DataAdapter that you use as a bridge between a data source and a DataSet.

  ClassDescription
Constraint Represents a constraint that can be enforced on one or more DataColumn objects.
ConstraintCollection Represents a collection of constraints for a DataTable.
ConstraintException Represents the exception that is thrown when attempting an action that violates a constraint.
DataColumn Represents the schema of a column in a DataTable.
DataColumnChangeEventArgs Provides data for the ColumnChanging event.
DataColumnCollection Represents a collection of DataColumn objects for a DataTable.
DataException Represents the exception that is thrown when errors are generated using ADO.NET components.
DataRelation Represents a parent/child relationship between two DataTable objects.
DataRelationCollection Represents the collection of DataRelation objects for this DataSet.
DataRow Represents a row of data in a DataTable.
DataRowBuilderInfrastructure. The DataRowBuilder type supports the .NET Framework infrastructure and is not intended to be used directly from your code.
DataRowChangeEventArgs Provides data for the RowChanged, RowChanging, OnRowDeleting, and OnRowDeleted events.
DataRowCollection Represents a collection of rows for a DataTable.
DataRowComparer Returns a singleton instance of the DataRowComparer<(Of <(TRow>)>) class.
DataRowComparer<(Of <(TRow>)>) Compares two DataRow objects for equivalence by using value-based comparison.
DataRowExtensions Defines the extension methods to the DataRow class. This is a static class.
DataRowView Represents a customized view of a DataRow.
DataSet Represents an in-memory cache of data.
DataSetSchemaImporterExtension This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
DataSysDescriptionAttribute Obsolete. Marks a property, event, or extender with a description. Visual designers can display this description when referencing the member.
DataTable Represents one table of in-memory data.
DataTableClearEventArgs Provides data for the Clear method.
DataTableCollection Represents the collection of tables for the DataSet.
DataTableExtensions Defines the extension methods to the DataTable class. DataTableExtensions is a static class.
DataTableNewRowEventArgs Provides data for the NewRow method.
DataTableReader The DataTableReader obtains the contents of one or more DataTable objects in the form of one or more read-only, forward-only result sets.
DataView Represents a databindable, customized view of a DataTable for sorting, filtering, searching, editing, and navigation.
DataViewManager Contains a default DataViewSettingCollection for each DataTable in a DataSet.
DataViewSetting Represents the default settings for ApplyDefaultSort, DataViewManager, RowFilter, RowStateFilter, Sort, and Table for DataViews created from the DataViewManager.
DataViewSettingCollection Contains a read-only collection of DataViewSetting objects for each DataTable in a DataSet.
DBConcurrencyException The exception that is thrown by the DataAdapter during an insert, update, or delete operation if the number of rows affected equals zero.
DeletedRowInaccessibleException Represents the exception that is thrown when an action is tried on a DataRow that has been deleted.
DuplicateNameException Represents the exception that is thrown when a duplicate database object name is encountered during an add operation in a DataSet -related object.
EntityCommandCompilationExceptionRepresents errors that occur during command compilation; when a command tree could not be produced to represent the command text.
EntityCommandExecutionExceptionRepresents errors that occur when the underlying storage provider could not execute the specified command. This exception usually wraps a provider-specific exception.
EntityExceptionRepresents Entity Framework-related errors that occur in the EntityClient namespace. The EntityException is the base class for all Entity Framework exceptions thrown by the EntityClient.
EntityKeyProvides a durable reference to an object that is an instance of an entity type.
EntityKeyMemberRepresents a key name and value pair that is part of an EntityKey.
EntitySqlExceptionRepresents errors that occur when parsing Entity SQL command text. This exception is thrown when syntactic or semantic rules are violated.
EnumerableRowCollection Represents a collection of DataRow objects returned from a LINQ to DataSet query. This API supports the .NET Framework infrastructure and is not intended to be used directly from your code. 
EnumerableRowCollection<(Of <(TRow>)>) Represents a collection of DataRow objects returned from a query. This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
EnumerableRowCollectionExtensions Contains the extension methods for the data row collection classes. This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
EvaluateException Represents the exception that is thrown when the Expression property of a DataColumn cannot be evaluated.
FillErrorEventArgs Provides data for the FillError event of a DbDataAdapter.
ForeignKeyConstraint Represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated.
InRowChangingEventException Represents the exception that is thrown when you call the EndEdit method within the RowChanging event.
InternalDataCollectionBase Provides the base functionality for creating collections.
InvalidCommandTreeExceptionThe exception that is thrown to indicate that a command tree is invalid.
InvalidConstraintException Represents the exception that is thrown when incorrectly trying to create or access a relation.
InvalidExpressionException Represents the exception that is thrown when you try to add a DataColumn that contains an invalid Expression to a DataColumnCollection.
MappingExceptionThe exception that is thrown when mapping related service requests fail.
MergeFailedEventArgs Occurs when a target and source DataRow have the same primary key value, and the EnforceConstraints property is set to true.
MetadataExceptionThe exception that is thrown when metadata related service requests fails.
MissingPrimaryKeyException Represents the exception that is thrown when you try to access a row in a table that has no primary key.
NoNullAllowedException Represents the exception that is thrown when you try to insert a null value into a column where AllowDBNull is set to false.
ObjectNotFoundExceptionThe exception that is thrown when an object is not present.
OperationAbortedException This exception is thrown when an ongoing operation is aborted by the user.
OptimisticConcurrencyExceptionThe exception that is thrown when an optimistic concurrency violation occurs.
OrderedEnumerableRowCollection<(Of <(TRow>)>) This API supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a collection of ordered DataRow objects returned from a query.
PropertyCollection Represents a collection of properties that can be added to DataColumn, DataSet, or DataTable.
ProviderIncompatibleExceptionThe exception that is thrown when the underlying data provider is incompatible with the Entity Framework.
ReadOnlyException Represents the exception that is thrown when you try to change the value of a read-only column.
RowNotInTableException Represents the exception that is thrown when you try to perform an operation on a DataRow that is not in a DataTable.
StateChangeEventArgs Provides data for the state change event of a .NET Framework data provider.
StatementCompletedEventArgs Provides additional information for the StatementCompleted event.
StrongTypingException The exception that is thrown by a strongly typed DataSet when the user accesses a DBNull value.
SyntaxErrorException Represents the exception that is thrown when the Expression property of a DataColumn contains a syntax error.
TypedDataSetGenerator Obsolete. Used to create a strongly typed DataSet.
TypedDataSetGeneratorException The exception that is thrown when a name conflict occurs while generating a strongly typed DataSet.
TypedTableBase<(Of <(T>)>) This type is used as a base class for typed-DataTable object generation by Visual Studio and the XSD.exe .NET Framework tool, and is not intended to be used directly from your code.
TypedTableBaseExtensions Contains the extension methods for the TypedTableBase<(Of <(T>)>) class.
UniqueConstraint Represents a restriction on a set of columns in which all values must be unique.
UpdateExceptionThe exception that is thrown when modifications to object instances cannot be persisted to the data source.
VersionNotFoundException Represents the exception that is thrown when you try to return a version of a DataRow that has been deleted.
  InterfaceDescription
IColumnMapping Associates a data source column with a DataSet column, and is implemented by the DataColumnMapping class, which is used in common by .NET Framework data providers.
IColumnMappingCollection Contains a collection of DataColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET Framework data providers.
IDataAdapter Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties that are used to fill and update a DataSet and update a data source.
IDataParameter Represents a parameter to a Command object, and optionally, its mapping to DataSet columns; and is implemented by .NET Framework data providers that access data sources.
IDataParameterCollection Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET Framework data providers that access data sources.
IDataReader Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET Framework data providers that access relational databases.
IDataRecord Provides access to the column values within each row for a DataReader, and is implemented by .NET Framework data providers that access relational databases.
IDbCommand Represents an SQL statement that is executed while connected to a data source, and is implemented by .NET Framework data providers that access relational databases.
IDbConnection Represents an open connection to a data source, and is implemented by .NET Framework data providers that access relational databases.
IDbDataAdapter Represents a set of command-related properties that are used to fill the DataSet and update a data source, and is implemented by .NET Framework data providers that access relational databases.
IDbDataParameter Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns.
IDbTransaction Represents a transaction to be performed at a data source, and is implemented by .NET Framework data providers that access relational databases.
IExtendedDataRecordProvides access to the column values within each row of a DbDataRecord for a DbDataReader.
ITableMapping Associates a source table with a table in a DataSet, and is implemented by the DataTableMapping class, which is used in common by .NET Framework data providers.
ITableMappingCollection Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET Framework data providers.