System.Data Namespace

System.Data 命名空間可用來存取表示 ADO.NET 架構的類別。 The System.Data namespace provides access to classes that represent the ADO.NET architecture. ADO.NET 可以讓您建置一些元件,有效地管理來自多個資料來源的資料。 ADO.NET lets you build components that efficiently manage data from multiple data sources.

類別

Constraint

表示可以在一或多個 DataColumn 物件上強制使用的條件約束。Represents a constraint that can be enforced on one or more DataColumn objects.

ConstraintCollection

表示為 DataTable 的條件約束 (Constraint) 集合。Represents a collection of constraints for a DataTable.

ConstraintException

代表嘗試進行違反條件約束的動作時,所擲回的例外狀況。Represents the exception that is thrown when attempting an action that violates a constraint.

DataColumn

表示 DataTable 中資料行的結構描述。Represents the schema of a column in a DataTable.

DataColumnChangeEventArgs

提供 ColumnChanging 事件的資料。Provides data for the ColumnChanging event.

DataColumnCollection

表示 DataColumnDataTable 物件集合。Represents a collection of DataColumn objects for a DataTable.

DataException

表示會在使用 ADO.NET 元件產生錯誤時所擲回的例外狀況。Represents the exception that is thrown when errors are generated using ADO.NET components.

DataReaderExtensions

提供 DbDataReader 的擴充方法。Provides extension methods for DbDataReader.

DataRelation

表示兩個 DataTable 物件之間的父子關聯性。Represents a parent/child relationship between two DataTable objects.

DataRelationCollection

表示這個 DataRelationDataSet 物件集合。Represents the collection of DataRelation objects for this DataSet.

DataRow

表示 DataTable 中的資料列。Represents a row of data in a DataTable.

DataRowBuilder

DataRowBuilder 型別支援 .NET Framework 基礎結構,而且不適合直接從您的程式碼使用。The DataRowBuilder type supports the .NET Framework infrastructure and is not intended to be used directly from your code.

DataRowChangeEventArgs

提供 RowChangedRowChangingOnRowDeleting(DataRowChangeEventArgs)OnRowDeleted(DataRowChangeEventArgs) 事件的資料。Provides data for the RowChanged, RowChanging, OnRowDeleting(DataRowChangeEventArgs), and OnRowDeleted(DataRowChangeEventArgs) events.

DataRowCollection

表示 DataTable 的資料列集合。Represents a collection of rows for a DataTable.

DataRowComparer

傳回 DataRowComparer<TRow> 類別的單一執行個體。Returns a singleton instance of the DataRowComparer<TRow> class.

DataRowComparer<TRow>

使用數值比較,比較兩個 DataRow 物件是否相等。Compares two DataRow objects for equivalence by using value-based comparison.

DataRowExtensions

定義 DataRow 類別的擴充方法。Defines the extension methods to the DataRow class. 這是靜態類別。This is a static class.

DataRowView

表示 DataRow 的自訂檢視。Represents a customized view of a DataRow.

DataSet

代表資料的記憶體中快取。Represents an in-memory cache of data.

DataSetSchemaImporterExtension

此成員支援 .NET Framework 基礎結構,並不能直接使用於您的程式碼中。This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

DataSysDescriptionAttribute

使用描述來標記屬性、事件或擴充項 (Extender)。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

提供 Clear() 方法的資料。Provides data for the Clear() method.

DataTableCollection

表示 DataSet 的資料表集合。Represents the collection of tables for the DataSet.

DataTableExtensions

定義 DataTable 類別的擴充方法。Defines the extension methods to the DataTable class. DataTableExtensions 為靜態類別。DataTableExtensions is a static class.

DataTableNewRowEventArgs

提供 NewRow() 方法的資料。Provides data for the NewRow() method.

DataTableReader

DataTableReader 會以一或多個唯讀、順向結果集的形式,取得一或多個 DataTable 物件的內容。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

代表用於排序、篩選、搜尋、編輯和巡覽的 DataTable 可資料繫結的自訂檢視。Represents a databindable, customized view of a DataTable for sorting, filtering, searching, editing, and navigation. DataView 不儲存資料,卻代表其對應之 DataTable 的連線檢視。The DataView does not store data, but instead represents a connected view of its corresponding DataTable. DataView 的資料變更會影響 DataTableChanges to the DataView's data will affect the DataTable. DataTable 的資料變更會影響所有與它建立關聯的 DataViewChanges to the DataTable's data will affect all DataViews associated with it.

DataViewManager

DataSet 中的每一個 DataTable 都包含預設的 DataViewSettingCollectionContains a default DataViewSettingCollection for each DataTable in a DataSet.

DataViewSetting

表示從 ApplyDefaultSort 建立之 DataView 的 DataViewManagerRowFilterRowStateFilterSortTableDataViewManager 等的預設值。Represents the default settings for ApplyDefaultSort, DataViewManager, RowFilter, RowStateFilter, Sort, and Table for DataViews created from the DataViewManager.

DataViewSettingCollection

含有在 DataViewSetting 中每個 DataTableDataSet 物件之唯讀集合。Contains a read-only collection of DataViewSetting objects for each DataTable in a DataSet.

DBConcurrencyException

受影響的資料列數目等於零時,由 DataAdapter 在插入、更新或刪除作業期間擲回的例外狀況。The exception that is thrown by the DataAdapter during an insert, update, or delete operation if the number of rows affected equals zero.

DeletedRowInaccessibleException

表示在已經刪除的 DataRow 上嘗試動作時所擲回的例外狀況。Represents the exception that is thrown when an action is tried on a DataRow that has been deleted.

DuplicateNameException

表示在 DataSet 相關物件中的加入作業期間遭遇重複的資料庫物件時所擲回的例外狀況。Represents the exception that is thrown when a duplicate database object name is encountered during an add operation in a DataSet -related object.

EntityCommandCompilationException

表示在命令編譯 (Compilation) 期間發生的錯誤。無法產生命令樹來代表命令文字時。Represents errors that occur during command compilation; when a command tree could not be produced to represent the command text.

EntityCommandExecutionException

表示在基礎儲存區提供者 (Provider) 無法執行指定之命令時所發生的錯誤。Represents errors that occur when the underlying storage provider could not execute the specified command. 這個例外狀況 (Exception) 通常會包裝提供者特有的例外狀況。This exception usually wraps a provider-specific exception.

EntityException

表示發生在 EntityClient 命名空間中的 Entity Framework 相關錯誤。Represents Entity Framework-related errors that occur in the EntityClient namespace. EntityExceptionEntityClient 擲回之所有 Entity Framework 例外狀況的基底類別。The EntityException is the base class for all Entity Framework exceptions thrown by the EntityClient.

EntityKey

提供實體 (Entity) 類型執行個體 (Instance) 之物件的持久參考。Provides a durable reference to an object that is an instance of an entity type.

EntityKeyMember

表示屬於 EntityKey 一部分的索引鍵名稱和值組。Represents a key name and value pair that is part of an EntityKey.

EntitySqlException

表示剖析 Entity SQL 命令文字時所發生的錯誤。Represents errors that occur when parsing Entity SQL command text. 違反語法或語意規則時,系統就會擲回此例外狀況 (Exception)。This exception is thrown when syntactic or semantic rules are violated.

EnumerableRowCollection

表示從 LINQ to DataSet 查詢所傳回之 DataRow 物件的集合。Represents a collection of DataRow objects returned from a LINQ to DataSet query. 這個 API 支援 .NET Framework 基礎結構,並不適合直接從您的程式碼中使用。This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

EnumerableRowCollection<TRow>

表示從查詢所傳回之 DataRow 物件的集合。Represents a collection of DataRow objects returned from a query.

EnumerableRowCollectionExtensions

包含資料列集合類別的擴充方法。Contains the extension methods for the data row collection classes.

EvaluateException

表示無法評估 ExpressionDataColumn 屬性時所擲回的例外狀況。Represents the exception that is thrown when the Expression property of a DataColumn cannot be evaluated.

FillErrorEventArgs

提供 FillErrorDbDataAdapter 事件的資料。Provides data for the FillError event of a DbDataAdapter.

ForeignKeyConstraint

表示值或資料列刪除或更新時,在主索引鍵/外部索引鍵關聯性 (Relationship) 中的資料行集上強制執行的動作限制。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

表示呼叫 EndEdit() 事件內的 RowChanging 方法時所擲回的例外狀況。Represents the exception that is thrown when you call the EndEdit() method within the RowChanging event.

InternalDataCollectionBase

提供建立集合的基底功能。Provides the base functionality for creating collections.

InvalidCommandTreeException

表示命令樹無效所擲回的例外狀況。The exception that is thrown to indicate that a command tree is invalid. 目前在實體架構中,並非任何位置都可擲回此例外狀況。This exception is currently not thrown anywhere in the Entity Framework.

InvalidConstraintException

表示錯誤嘗試建立或存取關聯時所擲回的例外狀況。Represents the exception that is thrown when incorrectly trying to create or access a relation.

InvalidExpressionException

表示在嘗試將含有無效之 DataColumnExpression 加入至 DataColumnCollection 時所擲回的例外狀況。Represents the exception that is thrown when you try to add a DataColumn that contains an invalid Expression to a DataColumnCollection.

MappingException

對應相關服務要求失敗時擲回的例外狀況。The exception that is thrown when mapping related service requests fail.

MergeFailedEventArgs

發生於目標和來源 DataRow 具有相同主索引鍵值,並且 EnforceConstraints 屬性設定為 True 時。Occurs when a target and source DataRow have the same primary key value, and the EnforceConstraints property is set to true.

MetadataException

中繼資料相關服務要求失敗時擲回的例外狀況。The 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

表示嘗試將 Null 值插入至 AllowDBNull 設定為 false 的資料行時會擲回的例外狀況。Represents the exception that is thrown when you try to insert a null value into a column where AllowDBNull is set to false.

ObjectNotFoundException

物件不存在時擲回的例外狀況。The exception that is thrown when an object is not present.

OperationAbortedException

當使用者中止了正在進行的作業時,會擲回這個例外狀況。This exception is thrown when an ongoing operation is aborted by the user.

OptimisticConcurrencyException

發生開放式同步存取違規時擲回的例外狀況。The exception that is thrown when an optimistic concurrency violation occurs.

OrderedEnumerableRowCollection<TRow>

代表從查詢傳回之已排序 DataRow 物件的集合。Represents a collection of ordered DataRow objects returned from a query.

PropertyCollection

表示可以加入至 DataColumnDataSetDataTable 的屬性集合。Represents a collection of properties that can be added to DataColumn, DataSet, or DataTable.

PropertyConstraintException

屬性條件約束例外狀況類別。Property constraint exception class. 請注意,這個類別有狀態,所以如果您甚至變更其內部項目時,這可能是中斷變更。Note that this class has state - so if you change even its internals, it can be a breaking change.

ProviderIncompatibleException

當基礎資料提供者與 Entity Framework 不相容時擲回的例外狀況。The 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

表示嘗試在不是位於 DataRow 中的 DataTable 上執行作業時所擲回的例外狀況。Represents the exception that is thrown when you try to perform an operation on a DataRow that is not in a DataTable.

StateChangeEventArgs

為 .NET Framework 資料提供者 (Data Provider) 的狀態變更事件提供資料。Provides data for the state change event of a .NET Framework data provider.

StatementCompletedEventArgs

提供 StatementCompleted 事件的其他資訊。Provides additional information for the StatementCompleted event.

StrongTypingException

例外狀況,會在使用者存取 DBNull 值時由強型別 (Strongly Typed) DataSet 擲回。The exception that is thrown by a strongly typed DataSet when the user accesses a DBNull value.

SyntaxErrorException

表示當 ExpressionDataColumn 屬性含有語法錯誤時所擲回的例外狀況。Represents the exception that is thrown when the Expression property of a DataColumn contains a syntax error.

TypedDataSetGenerator

用來建立強型別 (Strongly Typed) DataSetUsed to create a strongly typed DataSet.

TypedDataSetGeneratorException

產生強型別 (Strongly Typed) DataSet 卻發生名稱衝突時,所擲回的例外狀況。The exception that is thrown when a name conflict occurs while generating a strongly typed DataSet.

TypedTableBase<T>

這個類型在 Visual Studio 和 XSD.exe .NET Framework 工具產生 DataTable 型物件時使用作為基底類別,不能直接從程式碼使用。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

包含 TypedTableBase<T> 類別的擴充方法。Contains the extension methods for the TypedTableBase<T> class.

UniqueConstraint

表示所有值都必須是唯一的資料行集限制。Represents a restriction on a set of columns in which all values must be unique.

UpdateException

當物件執行個體的修改無法保存到資料來源時擲回的例外狀況。The exception that is thrown when modifications to object instances cannot be persisted to the data source.

VersionNotFoundException

表示在嘗試傳回已經刪除的 DataRow 版本時所傳回的例外狀況。Represents the exception that is thrown when you try to return a version of a DataRow that has been deleted.

介面

IColumnMapping

將資料來源資料行與 DataSet 資料行相關聯,並且由 DataColumnMapping 類別實作,這個類別是由 .NET Framework 資料提供者所共同使用。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

包含 DataColumnMapping 物件的集合,並且是由 DataColumnMappingCollection 所實作,這是由 .NET Framework 資料提供者 (Data Provider) 所共同使用。Contains a collection of DataColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET Framework data providers.

IDataAdapter

允許物件實作 DataAdapter,並表示用來填滿和更新 DataSet 並更新資料來源的方法集和對應動作相關屬性集。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.

IDbDataAdapter 執行個體適用於本身為 (或類似於) 採用文字命令 (例如 Transact-SQL) 之關聯式資料庫的資料來源,而 IDataAdapter 執行個體則可以使用任何類型的資料來源。IDbDataAdapter instances are for data sources that are (or resemble) relational databases with textual commands (like Transact-SQL), while IDataAdapter instances could can use any type of data source.

IDataParameter

代表 Command 物件的參數及 (選擇性) 其與 DataSet 資料行的對應,而且是由存取資料來源的 .NET Framework 資料提供者所實作。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

收集所有與 Command 物件相關的參數及其與 DataSet 資料行的對應,而且是由存取資料來源的 .NET Framework 資料提供者所實作。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

提供一種方法來讀取一或多個順向的結果集資料流 (這些結果集是在資料來源上執行命令而獲得的),而且是由存取關聯式資料庫的 .NET Framework 資料提供者所實作。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

針對 DataReader 提供存取每個資料列中資料行值的權限,而且是由存取關聯式資料庫的 .NET Framework 資料提供者所實作。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

代表在連接至資料來源時執行的 SQL 陳述式,而且是由存取關聯式資料庫的 .NET Framework 資料提供者所實作。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

代表連至資料來源的開放連線,而且是由存取關聯式資料庫的 .NET Framework 資料提供者所實作。Represents an open connection to a data source, and is implemented by .NET Framework data providers that access relational databases.

IDbDataAdapter

表示與命令相關的屬性集,這些屬性是用來填入 DataSet 並更新資料來源,並且由存取關聯式資料庫的 .NET Framework 資料提供者所實作。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

Visual Basic.NET 資料設計工具用來代表 Command 物件的參數,以及選擇性地代表其與 DataSet 資料行的對應。Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns.

IDbTransaction

代表要在資料來源上執行的交易,而且是由存取關聯式資料庫的 .NET Framework 資料提供者所實作。Represents a transaction to be performed at a data source, and is implemented by .NET Framework data providers that access relational databases.

IExtendedDataRecord

DbDataRecord 提供 DbDataReader 的每一資料列中資料行值的存取。Provides access to the column values within each row of a DbDataRecord for a DbDataReader.

ITableMapping

將來源資料表和 DataSet 中的資料表相關聯,並且由 .NET Framework 資料提供者 (Data Provider) 共同使用的 DataTableMapping 類別來實作。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

含有 TableMapping 物件的集合,並且是由 .NET Framework 資料提供者 (Data Provider) 共同使用的 DataTableMappingCollection 所實作。Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET Framework data providers.

列舉

AcceptRejectRule

判斷在具有 ForeignKeyConstraintDataTable 上叫用 AcceptChanges()RejectChanges() 方法時會發生的動作。Determines the action that occurs when the AcceptChanges() or RejectChanges() method is invoked on a DataTable with a 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.

DataRowAction

描述在 DataRow 上執行的動作。Describes an action performed on a DataRow.

DataRowState

取得 DataRow 物件的狀態。Gets the state of a DataRow object.

DataRowVersion

說明 DataRow 的版本。Describes the version of a DataRow.

DataSetDateTime

描述 DateTimeDataSet 資料行的序列化格式。Describes the serialization format for DateTime columns in a DataSet.

DataViewRowState

描述 DataRow 中的資料版本。Describes the version of data in a DataRow.

DbType

指定 .NET Framework 資料提供者 (Data Provider) 的欄位、屬性或 Parameter 物件的資料型別。Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider.

EntityState

實體 (Entity) 物件的狀態。The state of an entity object.

IsolationLevel

指定連接的異動鎖定行為。Specifies the transaction locking behavior for the connection.

KeyRestrictionBehavior

識別由 KeyRestrictions 屬性識別之連接字串 (Connection String) 參數 (允許或不允許) 的清單。Identifies a list of connection string parameters identified by the KeyRestrictions property that are either allowed or not allowed.

LoadOption

控制使用 LoadLoad 方法時,從資料來源取得的資料值應如何套用到現有的資料列上。Controls how the values from the data source will be applied to existing rows when using the Load or Load method.

MappingType

指定如何對應 DataColumnSpecifies how a DataColumn is mapped.

MissingMappingAction

判斷來源資料表或來源資料行中遺漏對應時會發生的動作。Determines the action that occurs when a mapping is missing from a source table or a source column.

MissingSchemaAction

指定在將資料加入至 DataSet 而且必要的 DataTableDataColumn 遺失時所要採取的動作。Specifies the action to take when adding data to the DataSet and the required DataTable or DataColumn is missing.

ParameterDirection

指定與 DataSet 相關查詢中的參數型別。Specifies the type of a parameter within a query relative to the DataSet.

PropertyAttributes

指定屬性 (Property) 的屬性 (Attribute)。Specifies the attributes of a property.

Rule

指示當強制使用 ForeignKeyConstraint 時發生的動作。Indicates the action that occurs when a ForeignKeyConstraint is enforced.

SchemaSerializationMode

指出型別 DataSet 的結構描述序列化模式。Indicates the schema serialization mode for a typed DataSet.

SchemaType

指定如何在執行 FillSchema(DataSet, SchemaType) 作業時處理現有的結構描述 (Schema) 對應。Specifies how to handle existing schema mappings when performing a FillSchema(DataSet, SchemaType) operation.

SerializationFormat

決定 DataSet 的序列化格式。Determines the serialization format for a DataSet.

SqlDbType

指定欄位的 SQL Server 特定的資料型別與屬性,以便在 SqlParameter 中使用。Specifies SQL Server-specific data type of a field, property, for use in a SqlParameter.

StatementType

指定要由 OleDbRowUpdatedEventArgsOleDbRowUpdatingEventArgsSqlRowUpdatedEventArgsSqlRowUpdatingEventArgs 類別使用的 SQL 查詢型別。Specifies the type of SQL query to be used by the OleDbRowUpdatedEventArgs, OleDbRowUpdatingEventArgs, SqlRowUpdatedEventArgs, or SqlRowUpdatingEventArgs class.

UpdateRowSource

指定如何將查詢命令結果套用到正在更新的資料列。Specifies how query command results are applied to the row being updated.

UpdateStatus

指定 Update(DataSet) 期間要採取關於目前和其餘資料列的動作。Specifies the action to take with regard to the current and remaining rows during an Update(DataSet).

XmlReadMode

指定如何將 XML 資料和關聯式結構描述讀入 DataSetSpecifies how to read XML data and a relational schema into a DataSet.

XmlWriteMode

指定如何從 DataSet 寫入 XML 資料和關聯式結構描述 (Schema)。Specifies how to write XML data and a relational schema from a DataSet.

委派

DataColumnChangeEventHandler

代表將處理 ColumnChanging 事件的方法。Represents the method that will handle the ColumnChanging event.

DataRowChangeEventHandler

表示處理 RowChangingRowChangedRowDeletingRowDeletedDataTable 事件的方法。Represents the method that will handle the RowChanging, RowChanged, RowDeleting, and RowDeleted events of a DataTable.

DataTableClearEventHandler

表示處理 Clear() 方法的方法。Represents the method that handles the Clear() method.

DataTableNewRowEventHandler

表示處理 NewRow() 方法的方法。Represents the method that handles the NewRow() method.

FillErrorEventHandler

代表將處理 FillError 事件的方法。Represents the method that will handle the FillError event.

MergeFailedEventHandler

代表將處理 MergeFailed 事件的方法。Represents the method that will handle the MergeFailed event.

StateChangeEventHandler

代表將處理 StateChange 事件的方法。Represents the method that will handle the StateChange event.

StatementCompletedEventHandler

StatementCompleted 事件之事件處理常式的委派型別。The delegate type for the event handlers of the StatementCompleted event.

備註

在中斷連接案例 (例如網際網路) 中,ADO.NET 提供可在多層式系統中要求、更新及協調資料的工具。In a disconnected scenario such as the Internet, ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems. ADO.NET 架構也實作於一些用戶端應用程式 (例如 Windows Form),或由 ASP.NET 建立的 HTML 頁面中。The ADO.NET architecture is also implemented in client applications, such as Windows Forms, or HTML pages created by ASP.NET.

ADO.NET 架構的中心部分就是 DataSet 類別。The centerpiece of the ADO.NET architecture is the DataSet class. 每個 DataSet 可以包含多個 DataTable 物件,且每個 DataTable 包含來自單一資料來源 (例如 SQL Server) 的資料。Each DataSet can contain multiple DataTable objects, with each DataTable containing data from a single data source, such as SQL Server.

每個 DataTable 包含一個用來判斷每個 DataColumnCollection 之結構描述的 DataColumn (即 DataTable 物件的集合)。Each DataTable contains a DataColumnCollection--a collection of DataColumn objects--that determines the schema of each DataTable. DataType 屬性會判斷 DataColumn 所持有資料的型別。The DataType property determines the type of data held by the DataColumn. ReadOnlyAllowDBNull 屬性可讓您進一步保證資料的完整性。The ReadOnly and AllowDBNull properties let you further guarantee data integrity. Expression 屬性可以讓您建構導出資料行。The Expression property lets you construct calculated columns.

如果 DataTable 要參與另一個 DataTable 的父/子關聯性,則此關聯性的建立方式是將 DataRelation 加入到 DataRelationCollection 物件的 DataSetIf 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. 加入這種關係之後,UniqueConstraintForeignKeyConstraint 兩者都會自動建立 (視建構函式的參數設定而定)。When such a relation is added, a UniqueConstraint and a ForeignKeyConstraint are both created automatically, depending on the parameter settings for the constructor. UniqueConstraint 可保證資料行中包含的值是唯一的。The UniqueConstraint guarantees that values that are contained in a column are unique. ForeignKeyConstraint 會在主索引鍵值變更或刪除時,判斷子資料列或資料行會發生何種動作。The ForeignKeyConstraint determines what action will happen to the child row or column when a primary key value is changed or deleted.

使用 System.Data.SqlClient 命名空間 (SQL Server 的 .NET Framework 資料提供者)、System.Data.Odbc 命名空間 ( ODBC 的 .NET Framework 資料提供者)、System.Data.OleDb 命名空間 (OLE DB 的 .NET Framework 資料提供者) 或 System.Data.OracleClient 命名空間 (Oracle 的 .NET Framework 資料提供者),您可以存取資料來源來搭配 DataSet 一起使用。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 資料提供者都有對應DataAdapter做為資料來源之間的橋樑, DataSetEach.NET Framework data provider has a corresponding DataAdapter that you use as a bridge between a data source and a DataSet.