System.Data Namespace

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.

Remarks

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 System.Data.DataSet class. Each System.Data.DataSet can contain multiple System.Data.DataTable objects, with each System.Data.DataTable containing data from a single data source, such as SQL Server.

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

If a System.Data.DataTable participates in a parent/child relationship with another System.Data.DataTable, the relationship is constructed by adding a System.Data.DataRelation to the System.Data.DataRelationCollection of a System.Data.DataSet object. When such a relation is added, a System.Data.UniqueConstraint and a System.Data.ForeignKeyConstraint are both created automatically, depending on the parameter settings for the constructor. The System.Data.UniqueConstraint guarantees that values that are contained in a column are unique. The System.Data.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 System.Data.DataSet. Each.NET Framework data provider has a corresponding DataAdapter that you use as a bridge between a data source and a System.Data.DataSet.

Classes

TypeReason
AcceptRejectRule

Determines the action that occurs when the System.Data.DataSet.AcceptChanges or System.Data.DataTable.RejectChanges method is invoked on a System.Data.DataTable with a System.Data.ForeignKeyConstraint.

CommandBehavior

Provides a description of the results of the query and its effect on the database.

CommandType

Specifies how a command string is interpreted.

ConflictOption

Specifies how conflicting changes to the data source will be detected and resolved.

ConnectionState

Describes the current state of the connection to a data source.

Constraint

Represents a constraint that can be enforced on one or more System.Data.DataColumn objects.

ConstraintCollection

Represents a collection of constraints for a System.Data.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 System.Data.DataTable.

DataColumnChangeEventArgs

Provides data for the System.Data.DataTable.ColumnChanging event.

DataColumnChangeEventHandler

Represents the method that will handle the System.Data.DataTable.ColumnChanging event.

DataColumnCollection

Represents a collection of System.Data.DataColumn objects for a System.Data.DataTable.

DataException

Represents the exception that is thrown when errors are generated using ADO.NET components.

DataRelation

Represents a parent/child relationship between two System.Data.DataTable objects.

DataRelationCollection

Represents the collection of System.Data.DataRelation objects for this System.Data.DataSet.

DataRow

Represents a row of data in a System.Data.DataTable.

DataRowAction

Describes an action performed on a System.Data.DataRow.

DataRowBuilder

The DataRowBuilder type supports the .NET Framework infrastructure and is not intended to be used directly from your code.

DataRowChangeEventArgs

Provides data for the System.Data.DataTable.RowChanged, System.Data.DataTable.RowChanging, System.Data.DataTable.OnRowDeleting(System.Data.DataRowChangeEventArgs), and System.Data.DataTable.OnRowDeleted(System.Data.DataRowChangeEventArgs) events.

DataRowChangeEventHandler

Represents the method that will handle the System.Data.DataTable.RowChanging, System.Data.DataTable.RowChanged, System.Data.DataTable.RowDeleting, and System.Data.DataTable.RowDeleted events of a System.Data.DataTable.

DataRowCollection

Represents a collection of rows for a System.Data.DataTable.

DataRowState

Gets the state of a System.Data.DataRow object.

DataRowVersion

Describes the version of a System.Data.DataRow.

DataRowView

Represents a customized view of a System.Data.DataRow.

DataSet

Represents an in-memory cache of data.

DataSetDateTime

Describes the serialization format for DateTime columns in a System.Data.DataSet.

DataSysDescriptionAttribute

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 System.Data.DataTable.Clear method.

DataTableClearEventHandler

Represents the method that handles the System.Data.DataTable.Clear method.

DataTableCollection

Represents the collection of tables for the System.Data.DataSet.

DataTableNewRowEventArgs

Provides data for the System.Data.DataTable.NewRow method.

DataTableNewRowEventHandler

Represents the method that handles the System.Data.DataTable.NewRow method.

DataTableReader

The System.Data.DataTableReader obtains the contents of one or more System.Data.DataTable objects in the form of one or more read-only, forward-only result sets.

DataView

Represents a databindable, customized view of a System.Data.DataTable for sorting, filtering, searching, editing, and navigation. The System.Data.DataView does not store data, but instead represents a connected view of its corresponding System.Data.DataTable. Changes to the System.Data.DataView’s data will affect the System.Data.DataTable. Changes to the System.Data.DataTable’s data will affect all System.Data.DataViews associated with it.

DataViewManager

Contains a default System.Data.DataViewSettingCollection for each System.Data.DataTable in a System.Data.DataSet.

DataViewRowState

Describes the version of data in a System.Data.DataRow.

DataViewSetting

Represents the default settings for System.Data.DataView.ApplyDefaultSort, System.Data.DataView.DataViewManager, System.Data.DataView.RowFilter, System.Data.DataView.RowStateFilter, System.Data.DataView.Sort, and System.Data.DataView.Table for DataViews created from the System.Data.DataViewManager.

DataViewSettingCollection

Contains a read-only collection of System.Data.DataViewSetting objects for each System.Data.DataTable in a System.Data.DataSet.

DBConcurrencyException

The exception that is thrown by the System.Data.Common.DataAdapter during an insert, update, or delete operation if the number of rows affected equals zero.

DbType

Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider.

DeletedRowInaccessibleException

Represents the exception that is thrown when an action is tried on a System.Data.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 System.Data.DataSet -related object.

EvaluateException

Represents the exception that is thrown when the System.Data.DataColumn.Expression property of a System.Data.DataColumn cannot be evaluated.

FillErrorEventArgs

Provides data for the System.Data.Common.DataAdapter.FillError event of a System.Data.Common.DbDataAdapter.

FillErrorEventHandler

Represents the method that will handle the System.Data.Common.DataAdapter.FillError event.

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.

IColumnMapping

Associates a data source column with a System.Data.DataSet column, and is implemented by the System.Data.Common.DataColumnMapping class, which is used in common by .NET Framework data providers.

IColumnMappingCollection

Contains a collection of DataColumnMapping objects, and is implemented by the System.Data.Common.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 System.Data.DataSet and update a data source.

System.Data.IDbDataAdapter instances are for data sources that are (or resemble) relational databases with textual commands (like tsql), while System.Data.IDataAdapter instances could can use any type of data source.

IDataParameter

Represents a parameter to a Command object, and optionally, its mapping to System.Data.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 System.Data.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 System.Data.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 System.Data.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.

InRowChangingEventException

Represents the exception that is thrown when you call the System.Data.DataRow.EndEdit method within the System.Data.DataTable.RowChanging event.

InternalDataCollectionBase

Provides the base functionality for creating collections.

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 System.Data.DataColumn that contains an invalid System.Data.DataColumn.Expression to a System.Data.DataColumnCollection.

IsolationLevel

Specifies the transaction locking behavior for the connection.

ITableMapping

Associates a source table with a table in a System.Data.DataSet, and is implemented by the System.Data.Common.DataTableMapping class, which is used in common by .NET Framework data providers.

ITableMappingCollection

Contains a collection of TableMapping objects, and is implemented by the System.Data.Common.DataTableMappingCollection, which is used in common by .NET Framework data providers.

KeyRestrictionBehavior

Identifies a list of connection string parameters identified by the KeyRestrictions property that are either allowed or not allowed.

LoadOption

Controls how the values from the data source will be applied to existing rows when using the erload:System.Data.DataTable.Load or erload:System.Data.DataSet.Load method.

MappingType

Specifies how a System.Data.DataColumn is mapped.

MergeFailedEventArgs

Occurs when a target and source DataRow have the same primary key value, and the System.Data.DataSet.EnforceConstraints property is set to true.

MergeFailedEventHandler

Represents the method that will handle the System.Data.DataSet.MergeFailed event.

MissingMappingAction

Determines the action that occurs when a mapping is missing from a source table or a source column.

MissingPrimaryKeyException

Represents the exception that is thrown when you try to access a row in a table that has no primary key.

MissingSchemaAction

Specifies the action to take when adding data to the System.Data.DataSet and the required System.Data.DataTable or System.Data.DataColumn is missing.

NoNullAllowedException

Represents the exception that is thrown when you try to insert a null value into a column where System.Data.DataColumn.AllowDBNull is set to false.

OperationAbortedException

This exception is thrown when an ongoing operation is aborted by the user.

ParameterDirection

Specifies the type of a parameter within a query relative to the System.Data.DataSet.

PropertyAttributes

Specifies the attributes of a property.

PropertyCollection

Represents a collection of properties that can be added to System.Data.DataColumn, System.Data.DataSet, or System.Data.DataTable.

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 System.Data.DataRow that is not in a System.Data.DataTable.

Rule

Indicates the action that occurs when a System.Data.ForeignKeyConstraint is enforced.

SchemaSerializationMode

Indicates the schema serialization mode for a typed System.Data.DataSet.

SchemaType

Specifies how to handle existing schema mappings when performing a System.Data.Common.DataAdapter.FillSchema(System.Data.DataSet, System.Data.SchemaType) operation.

SerializationFormat

Determines the serialization format for a System.Data.DataSet.

SqlDbType

Specifies SQL Server-specific data type of a field, property, for use in a System.Data.SqlClient.SqlParameter.

StateChangeEventArgs

Provides data for the state change event of a .NET Framework data provider.

StateChangeEventHandler

Represents the method that will handle the System.Data.Common.DbConnection.StateChange event.

StatementCompletedEventArgs

Provides additional information for the System.Data.SqlClient.SqlCommand.StatementCompleted event.

StatementCompletedEventHandler

The delegate type for the event handlers of the System.Data.SqlClient.SqlCommand.StatementCompleted event.

StatementType

Specifies the type of SQL query to be used by the System.Data.OleDb.OleDbRowUpdatedEventArgs, System.Data.OleDb.OleDbRowUpdatingEventArgs, System.Data.SqlClient.SqlRowUpdatedEventArgs, or System.Data.SqlClient.SqlRowUpdatingEventArgs class.

StrongTypingException

The exception that is thrown by a strongly typed System.Data.DataSet when the user accesses a DBNull value.

SyntaxErrorException

Represents the exception that is thrown when the System.Data.DataColumn.Expression property of a System.Data.DataColumn contains a syntax error.

TypedDataSetGenerator

Used to create a strongly typed System.Data.DataSet.

TypedDataSetGeneratorException

The exception that is thrown when a name conflict occurs while generating a strongly typed System.Data.DataSet.

UniqueConstraint

Represents a restriction on a set of columns in which all values must be unique.

UpdateRowSource

Specifies how query command results are applied to the row being updated.

UpdateStatus

Specifies the action to take with regard to the current and remaining rows during an System.Data.Common.DbDataAdapter.Update(System.Data.DataSet).

VersionNotFoundException

Represents the exception that is thrown when you try to return a version of a System.Data.DataRow that has been deleted.

XmlReadMode

Specifies how to read XML data and a relational schema into a System.Data.DataSet.

XmlWriteMode

Specifies how to write XML data and a relational schema from a System.Data.DataSet.