SqlDataAdapter SqlDataAdapter SqlDataAdapter SqlDataAdapter Class

定義

表示一組資料命令集和資料庫連接,這些是用來填入 DataSet 並更新 SQL Server 資料庫。Represents a set of data commands and a database connection that are used to fill the DataSet and update a SQL Server database. 這個類別無法被繼承。This class cannot be inherited.

public ref class SqlDataAdapter sealed : System::Data::Common::DbDataAdapter, ICloneable
public sealed class SqlDataAdapter : System.Data.Common.DbDataAdapter, ICloneable
type SqlDataAdapter = class
    inherit DbDataAdapter
    interface IDbDataAdapter
    interface IDataAdapter
    interface ICloneable
Public NotInheritable Class SqlDataAdapter
Inherits DbDataAdapter
Implements ICloneable
繼承
實作

範例

下列範例會使用SqlCommandSqlDataAdapter,並SqlConnection以從資料庫選取資料錄,並填入DataSet與選取的資料列。The following example uses the SqlCommand, SqlDataAdapter, and SqlConnection to select records from a database and populate a DataSet with the selected rows. 區域分布DataSet再傳回。The filled DataSet is then returned. 若要這麼做,方法傳遞初始化DataSet,連接字串,而是 TRANSACT-SQL SELECT 陳述式的查詢字串。To accomplish this, the method is passed an initialized DataSet, a connection string, and a query string that is a Transact-SQL SELECT statement.

private static DataSet SelectRows(DataSet dataset,
    string connectionString,string queryString) 
{
    using (SqlConnection connection = 
        new SqlConnection(connectionString))
    {
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand(
            queryString, connection);
        adapter.Fill(dataset);
        return dataset;
    }
}

Public Function SelectRows( _
    ByVal dataSet As DataSet, ByVal connectionString As String, _
    ByVal queryString As String) As DataSet

    Using connection As New SqlConnection(connectionString)
        Dim adapter As New SqlDataAdapter()
        adapter.SelectCommand = New SqlCommand( _
            queryString, connection)
        adapter.Fill(dataSet)
        Return dataSet
    End Using
End Function

備註

SqlDataAdapter,可作為橋樑DataSet和用來擷取並儲存資料的 SQL Server。The SqlDataAdapter, serves as a bridge between a DataSet and SQL Server for retrieving and saving data. SqlDataAdapter對應中提供此橋接器Fill,變更中的資料DataSet以符合資料來源中的資料和Update,如此會變更要比對中的資料的資料來源中的資料DataSet,並使用針對資料來源的適當 TRANSACT-SQL 陳述式。The SqlDataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet, using the appropriate Transact-SQL statements against the data source. 更新會逐列方式執行。The update is performed on a by-row basis. 每個插入、 修改和刪除資料列Update方法會判斷已在其執行的變更類型 (InsertUpdate,或Delete)。For every inserted, modified, and deleted row, the Update method determines the type of change that has been performed on it (Insert, Update, or Delete). 視變更類型而定InsertUpdate,或Delete傳播到資料來源已修改的資料列中執行命令範本。Depending on the type of change, the Insert, Update, or Delete command template executes to propagate the modified row to the data source. SqlDataAdapter填滿DataSet,它會建立必要的資料表和資料行傳回的資料如果它們尚不存在。When the SqlDataAdapter fills a DataSet, it creates the necessary tables and columns for the returned data if they do not already exist. 不過,主索引鍵資訊不會納入以隱含方式建立的結構描述除非MissingSchemaAction屬性設定為AddWithKeyHowever, primary key information is not included in the implicitly created schema unless the MissingSchemaAction property is set to AddWithKey. 您也可以SqlDataAdapter建立的結構描述DataSet,包括主索引鍵資訊的詳細資訊,再填入資料使用FillSchemaYou may also have the SqlDataAdapter create the schema of the DataSet, including primary key information, before filling it with data using FillSchema. 如需詳細資訊,請參閱 < 將現有條件約束加入至資料集For more information, see Adding Existing Constraints to a DataSet.

SqlDataAdapter 用於搭配SqlConnectionSqlCommand來提升效能,當連接到 SQL Server 資料庫。SqlDataAdapter is used in conjunction with SqlConnection and SqlCommand to increase performance when connecting to a SQL Server database.

注意

如果您要使用 SQL Server 預存程序搭配 DataAdapter 來編輯或刪除資料,請務必不要在預存程序定義中使用 SET NOCOUNT ON。If you are using SQL Server stored procedures to edit or delete data using a DataAdapter, make sure that you do not use SET NOCOUNT ON in the stored procedure definition. 因為這樣會讓傳回的受影響資料列計數成為零,而 DataAdapter 會將它解譯為並行衝突。This causes the rows affected count returned to be zero, which the DataAdapter interprets as a concurrency conflict. 在此事件中,系統會擲回 DBConcurrencyExceptionIn this event, a DBConcurrencyException will be thrown.

SqlDataAdapter也包含SelectCommandInsertCommandDeleteCommandUpdateCommand,和TableMappings屬性,以加速的載入和更新的資料。The SqlDataAdapter also includes the SelectCommand, InsertCommand, DeleteCommand, UpdateCommand, and TableMappings properties to facilitate the loading and updating of data.

執行個體時SqlDataAdapter建立時,讀取/寫入屬性會設為初始值。When an instance of SqlDataAdapter is created, the read/write properties are set to initial values. 如需這些值的清單,請參閱SqlDataAdapter建構函式。For a list of these values, see the SqlDataAdapter constructor.

InsertCommandDeleteCommand,和UpdateCommand都透過參數機制會自動填滿每個已修改的資料列中的個別值的通用範本。The InsertCommand, DeleteCommand, and UpdateCommand are generic templates that are automatically filled with individual values from every modified row through the parameters mechanism.

每個資料行,將資料來源Update,將參數應該新增至InsertCommandUpdateCommand,或DeleteCommandFor every column that you propagate to the data source on Update, a parameter should be added to the InsertCommand, UpdateCommand, or DeleteCommand. SourceColumn屬性DbParameter物件應該設定為資料行的名稱。The SourceColumn property of the DbParameter object should be set to the name of the column. 這個設定表示參數的值並非手動設定,而來自目前處理的資料列中的特定資料行。This setting indicates that the value of the parameter is not set manually, but is taken from the particular column in the currently processed row.

注意

InvalidOperationException如果將會發生Fill方法呼叫,而且資料表包含不是用戶端電腦上可用的使用者定義型別。An InvalidOperationException will occur if the Fill method is called and the table contains a user-defined type that is not available on the client computer. 如需詳細資訊,請參閱 < clr 使用者定義型別For more information, see CLR User-Defined Types.

建構函式

SqlDataAdapter() SqlDataAdapter() SqlDataAdapter() SqlDataAdapter()

初始化 SqlDataAdapter 類別的新執行個體。Initializes a new instance of the SqlDataAdapter class.

SqlDataAdapter(SqlCommand) SqlDataAdapter(SqlCommand) SqlDataAdapter(SqlCommand) SqlDataAdapter(SqlCommand)

使用指定 SqlDataAdapter 做為 SqlCommand 屬性,初始化 SelectCommand 類別的新執行個體。Initializes a new instance of the SqlDataAdapter class with the specified SqlCommand as the SelectCommand property.

SqlDataAdapter(String, SqlConnection) SqlDataAdapter(String, SqlConnection) SqlDataAdapter(String, SqlConnection) SqlDataAdapter(String, SqlConnection)

使用 SqlDataAdapterSelectCommand 物件,初始化 SqlConnection 類別的新執行個體。Initializes a new instance of the SqlDataAdapter class with a SelectCommand and a SqlConnection object.

SqlDataAdapter(String, String) SqlDataAdapter(String, String) SqlDataAdapter(String, String) SqlDataAdapter(String, String)

使用 SqlDataAdapter 和連接字串,初始化 SelectCommand 類別的新執行個體。Initializes a new instance of the SqlDataAdapter class with a SelectCommand and a connection string.

屬性

AcceptChangesDuringFill AcceptChangesDuringFill AcceptChangesDuringFill AcceptChangesDuringFill

取得或設定值,指出在任何一種 Fill 作業期間,當 DataRow 新增至 DataTable 之後,是否要在其上呼叫 AcceptChanges()Gets or sets a value indicating whether AcceptChanges() is called on a DataRow after it is added to the DataTable during any of the Fill operations.

(Inherited from DataAdapter)
AcceptChangesDuringUpdate AcceptChangesDuringUpdate AcceptChangesDuringUpdate AcceptChangesDuringUpdate

取得或設定在 AcceptChanges() 期間是否呼叫 Update(DataSet)Gets or sets whether AcceptChanges() is called during a Update(DataSet).

(Inherited from DataAdapter)
CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents

取得值,指出元件是否能引發事件。Gets a value indicating whether the component can raise an event.

(Inherited from Component)
Container Container Container Container

取得包含 IContainerComponentGets the IContainer that contains the Component.

(Inherited from Component)
ContinueUpdateOnError ContinueUpdateOnError ContinueUpdateOnError ContinueUpdateOnError

取得或設定數值,指定當資料列更新期間發生錯誤時,是否產生例外狀況。Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.

(Inherited from DataAdapter)
DeleteCommand DeleteCommand DeleteCommand DeleteCommand

取得或設定要從資料集刪除資料錄的 Transact-SQL 陳述式或預存程序。Gets or sets a Transact-SQL statement or stored procedure to delete records from the data set.

DesignMode DesignMode DesignMode DesignMode

取得值,指出 Component 目前是否處於設計模式。Gets a value that indicates whether the Component is currently in design mode.

(Inherited from Component)
Events Events Events Events

取得附加在這個 Component 上的事件處理常式清單。Gets the list of event handlers that are attached to this Component.

(Inherited from Component)
FillCommandBehavior FillCommandBehavior FillCommandBehavior FillCommandBehavior

取得或設定用來填入資料配接器 (Adapter) 之命令的行為。Gets or sets the behavior of the command used to fill the data adapter.

(Inherited from DbDataAdapter)
FillLoadOption FillLoadOption FillLoadOption FillLoadOption

取得或設定 LoadOption,決定配接器如何從 DataTable 填入 DbDataReaderGets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader.

(Inherited from DataAdapter)
IDataAdapter.TableMappings IDataAdapter.TableMappings IDataAdapter.TableMappings IDataAdapter.TableMappings

指示來源資料表如何對應至資料集資料表。Indicates how a source table is mapped to a dataset table.

(Inherited from DataAdapter)
InsertCommand InsertCommand InsertCommand InsertCommand

取得或設定要將新資料錄插入至資料來源的 Transact-SQL 陳述式或預存程序。Gets or sets a Transact-SQL statement or stored procedure to insert new records into the data source.

MissingMappingAction MissingMappingAction MissingMappingAction MissingMappingAction

判斷在傳入的資料不具有相符的資料表或資料行時要採取的動作。Determines the action to take when incoming data does not have a matching table or column.

(Inherited from DataAdapter)
MissingSchemaAction MissingSchemaAction MissingSchemaAction MissingSchemaAction

判斷在現有 DataSet 結構描述 (Schema) 與傳入的資料不相符時要採取的動作。Determines the action to take when existing DataSet schema does not match incoming data.

(Inherited from DataAdapter)
ReturnProviderSpecificTypes ReturnProviderSpecificTypes ReturnProviderSpecificTypes ReturnProviderSpecificTypes

取得或設定 Fill 方法應當傳回提供者特定的值,還是通用符合 CLS 標準的值。Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.

(Inherited from DataAdapter)
SelectCommand SelectCommand SelectCommand SelectCommand

取得或設定用來在資料來源中選取資料錄的 Transact-SQL 陳述式或預存程序。Gets or sets a Transact-SQL statement or stored procedure used to select records in the data source.

Site Site Site Site

取得或設定 ComponentISiteGets or sets the ISite of the Component.

(Inherited from Component)
TableMappings TableMappings TableMappings TableMappings

取得提供來源資料表和 DataTable 之間主要對應的集合。Gets a collection that provides the master mapping between a source table and a DataTable.

(Inherited from DataAdapter)
UpdateBatchSize UpdateBatchSize UpdateBatchSize UpdateBatchSize

取得或設定每一次來回存取伺服器時所處理的資料列數目。Gets or sets the number of rows that are processed in each round-trip to the server.

UpdateCommand UpdateCommand UpdateCommand UpdateCommand

取得或設定用來在資料來源中更新資料錄的 SQL 陳述式或預存程序。Gets or sets a Transact-SQL statement or stored procedure used to update records in the data source.

事件

Disposed Disposed Disposed Disposed

當此元件由 Dispose() 方法的呼叫處置時發生。Occurs when the component is disposed by a call to the Dispose() method.

(Inherited from Component)
FillError FillError FillError FillError

當填入作業期間發生錯誤時傳回。Returned when an error occurs during a fill operation.

(Inherited from DbDataAdapter)
RowUpdated RowUpdated RowUpdated RowUpdated

發生在已經針對資料來源執行命令後的 Update(DataSet) 期間。Occurs during Update(DataSet) after a command is executed against the data source. 嘗試進行更新,因此引發了事件。The attempt to update is made, so the event fires.

RowUpdating RowUpdating RowUpdating RowUpdating

發生在已經針對資料來源執行命令前的 Update(DataSet) 期間。Occurs during Update(DataSet) before a command is executed against the data source. 嘗試進行更新,因此引發了事件。The attempt to update is made, so the event fires.

明確介面實作

ICloneable.Clone() ICloneable.Clone() ICloneable.Clone() ICloneable.Clone()

如需這個成員的說明,請參閱 Clone()For a description of this member, see Clone().

IDbDataAdapter.DeleteCommand IDbDataAdapter.DeleteCommand IDbDataAdapter.DeleteCommand IDbDataAdapter.DeleteCommand

如需這個成員的說明,請參閱 DeleteCommandFor a description of this member, see DeleteCommand.

IDbDataAdapter.InsertCommand IDbDataAdapter.InsertCommand IDbDataAdapter.InsertCommand IDbDataAdapter.InsertCommand

如需這個成員的說明,請參閱 InsertCommandFor a description of this member, see InsertCommand.

IDbDataAdapter.SelectCommand IDbDataAdapter.SelectCommand IDbDataAdapter.SelectCommand IDbDataAdapter.SelectCommand

如需這個成員的說明,請參閱 SelectCommandFor a description of this member, see SelectCommand.

IDbDataAdapter.UpdateCommand IDbDataAdapter.UpdateCommand IDbDataAdapter.UpdateCommand IDbDataAdapter.UpdateCommand

如需這個成員的說明,請參閱 UpdateCommandFor a description of this member, see UpdateCommand.

方法

AddToBatch(IDbCommand) AddToBatch(IDbCommand) AddToBatch(IDbCommand) AddToBatch(IDbCommand)

加入 IDbCommand 至目前批次。Adds a IDbCommand to the current batch.

(Inherited from DbDataAdapter)
ClearBatch() ClearBatch() ClearBatch() ClearBatch()

將所有的 IDbCommand 物件從批次中移除。Removes all IDbCommand objects from the batch.

(Inherited from DbDataAdapter)
CloneInternals() CloneInternals() CloneInternals() CloneInternals()

建立 DataAdapter 的這個執行個體的複本。Creates a copy of this instance of DataAdapter.

(Inherited from DataAdapter)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping)

初始化 RowUpdatedEventArgs 類別的新執行個體。Initializes a new instance of the RowUpdatedEventArgs class.

(Inherited from DbDataAdapter)
CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping) CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping)

初始化 RowUpdatingEventArgs 類別的新執行個體。Initializes a new instance of the RowUpdatingEventArgs class.

(Inherited from DbDataAdapter)
CreateTableMappings() CreateTableMappings() CreateTableMappings() CreateTableMappings()

建立新的 DataTableMappingCollectionCreates a new DataTableMappingCollection.

(Inherited from DataAdapter)
Dispose() Dispose() Dispose() Dispose()

釋放 Component 所使用的所有資源。Releases all resources used by the Component.

(Inherited from Component)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 DbDataAdapter 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DbDataAdapter and optionally releases the managed resources.

(Inherited from DbDataAdapter)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExecuteBatch() ExecuteBatch() ExecuteBatch() ExecuteBatch()

執行目前批次。Executes the current batch.

(Inherited from DbDataAdapter)
Fill(DataSet) Fill(DataSet) Fill(DataSet) Fill(DataSet)

DataSet 中加入或重新整理資料列。Adds or refreshes rows in the DataSet.

(Inherited from DbDataAdapter)
Fill(DataSet, Int32, Int32, String) Fill(DataSet, Int32, Int32, String) Fill(DataSet, Int32, Int32, String) Fill(DataSet, Int32, Int32, String)

使用 DataSetDataSet 名稱,加入或重新整理 DataTable 中指定範圍內的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.

(Inherited from DbDataAdapter)
Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior) Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior) Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior) Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior)

使用 DataSet、來源資料表名稱、命令字串和命令行為,加入或重新整理 DataSet 中指定範圍內的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and source table names, command string, and command behavior.

(Inherited from DbDataAdapter)
Fill(DataSet, String) Fill(DataSet, String) Fill(DataSet, String) Fill(DataSet, String)

使用 DataSetDataSet 名稱,加入或重新整理 DataTable 中的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in the DataSet to match those in the data source using the DataSet and DataTable names.

(Inherited from DbDataAdapter)
Fill(DataSet, String, IDataReader, Int32, Int32) Fill(DataSet, String, IDataReader, Int32, Int32) Fill(DataSet, String, IDataReader, Int32, Int32) Fill(DataSet, String, IDataReader, Int32, Int32)

使用 DataSetDataTableIDataReader 名稱,新增或重新整理 DataSet 中指定範圍內的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet, DataTable, and IDataReader names.

(Inherited from DbDataAdapter)
Fill(DataTable) Fill(DataTable) Fill(DataTable) Fill(DataTable)

使用 DataSet 名稱,加入或重新整理 DataTable 中指定範圍內的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataTable name.

(Inherited from DbDataAdapter)
Fill(DataTable, IDataReader) Fill(DataTable, IDataReader) Fill(DataTable, IDataReader) Fill(DataTable, IDataReader)

使用指定的 DataTableIDataReader 名稱,新增或重新整理 DataTable 中的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable and IDataReader names.

(Inherited from DbDataAdapter)
Fill(DataTable, IDbCommand, CommandBehavior) Fill(DataTable, IDbCommand, CommandBehavior) Fill(DataTable, IDbCommand, CommandBehavior) Fill(DataTable, IDbCommand, CommandBehavior)

使用指定的 DataTableDataTableIDbCommand,加入或重新整理 CommandBehavior 中的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable, IDbCommand and CommandBehavior.

(Inherited from DbDataAdapter)
Fill(DataTable[], IDataReader, Int32, Int32) Fill(DataTable[], IDataReader, Int32, Int32) Fill(DataTable[], IDataReader, Int32, Int32) Fill(DataTable[], IDataReader, Int32, Int32)

DataTable 物件集合中所指定的範圍內加入或重新整理資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the collection of DataTable objects to match those in the data source.

(Inherited from DataAdapter)
Fill(DataTable[], Int32, Int32, IDbCommand, CommandBehavior) Fill(DataTable[], Int32, Int32, IDbCommand, CommandBehavior) Fill(DataTable[], Int32, Int32, IDbCommand, CommandBehavior) Fill(DataTable[], Int32, Int32, IDbCommand, CommandBehavior)

使用 DataSetDataSet 名稱,加入或重新整理 DataTable 中指定範圍內的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.

(Inherited from DbDataAdapter)
Fill(Int32, Int32, DataTable[]) Fill(Int32, Int32, DataTable[]) Fill(Int32, Int32, DataTable[]) Fill(Int32, Int32, DataTable[])

從指定的記錄開始擷取直到指定的記錄最大數目為止,加入或重新整理 DataTable 中的資料列,以符合那些在資料來源中的資料列。Adds or refreshes rows in a DataTable to match those in the data source starting at the specified record and retrieving up to the specified maximum number of records.

(Inherited from DbDataAdapter)
FillSchema(DataSet, SchemaType) FillSchema(DataSet, SchemaType) FillSchema(DataSet, SchemaType) FillSchema(DataSet, SchemaType)

將名稱為 "Table" 的 DataTable 加入至指定的 DataSet,並根據指定的 SchemaType,設定結構描述以符合資料來源中的資料表。Adds a DataTable named "Table" to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.

(Inherited from DbDataAdapter)
FillSchema(DataSet, SchemaType, IDbCommand, String, CommandBehavior) FillSchema(DataSet, SchemaType, IDbCommand, String, CommandBehavior) FillSchema(DataSet, SchemaType, IDbCommand, String, CommandBehavior) FillSchema(DataSet, SchemaType, IDbCommand, String, CommandBehavior)

DataTable 加入至指定的 DataSet,並且根據指定的 SchemaType 設定結構描述,以符合資料來源中的資料表。Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.

(Inherited from DbDataAdapter)
FillSchema(DataSet, SchemaType, String) FillSchema(DataSet, SchemaType, String) FillSchema(DataSet, SchemaType, String) FillSchema(DataSet, SchemaType, String)

DataTable 加入至指定的 DataSet,並且根據指定的 SchemaTypeDataTable 設定結構描述,以符合資料來源中的資料表。Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based upon the specified SchemaType and DataTable.

(Inherited from DbDataAdapter)
FillSchema(DataSet, SchemaType, String, IDataReader) FillSchema(DataSet, SchemaType, String, IDataReader) FillSchema(DataSet, SchemaType, String, IDataReader) FillSchema(DataSet, SchemaType, String, IDataReader)

DataTable 加入至指定的 DataSetAdds a DataTable to the specified DataSet.

(Inherited from DataAdapter)
FillSchema(DataTable, SchemaType) FillSchema(DataTable, SchemaType) FillSchema(DataTable, SchemaType) FillSchema(DataTable, SchemaType)

根據指定的 DataTable,設定指定 SchemaType 的結構描述。Configures the schema of the specified DataTable based on the specified SchemaType.

(Inherited from DbDataAdapter)
FillSchema(DataTable, SchemaType, IDataReader) FillSchema(DataTable, SchemaType, IDataReader) FillSchema(DataTable, SchemaType, IDataReader) FillSchema(DataTable, SchemaType, IDataReader)

DataTable 加入至指定的 DataSetAdds a DataTable to the specified DataSet.

(Inherited from DataAdapter)
FillSchema(DataTable, SchemaType, IDbCommand, CommandBehavior) FillSchema(DataTable, SchemaType, IDbCommand, CommandBehavior) FillSchema(DataTable, SchemaType, IDbCommand, CommandBehavior) FillSchema(DataTable, SchemaType, IDbCommand, CommandBehavior)

根據指定的 DataTable、命令字串和 SchemaType 值,設定指定 CommandBehavior 的結構描述。Configures the schema of the specified DataTable based on the specified SchemaType, command string, and CommandBehavior values.

(Inherited from DbDataAdapter)
GetBatchedParameter(Int32, Int32) GetBatchedParameter(Int32, Int32) GetBatchedParameter(Int32, Int32) GetBatchedParameter(Int32, Int32)

從目前批次中的其中一個命令傳回 IDataParameterReturns a IDataParameter from one of the commands in the current batch.

(Inherited from DbDataAdapter)
GetBatchedRecordsAffected(Int32, Int32, Exception) GetBatchedRecordsAffected(Int32, Int32, Exception) GetBatchedRecordsAffected(Int32, Int32, Exception) GetBatchedRecordsAffected(Int32, Int32, Exception)

傳回在較大之批次更新中嘗試個別更新的相關資訊。Returns information about an individual update attempt within a larger batched update.

(Inherited from DbDataAdapter)
GetFillParameters() GetFillParameters() GetFillParameters() GetFillParameters()

取得在執行 SQL SELECT 陳述式時由使用者設定的參數。Gets the parameters set by the user when executing an SQL SELECT statement.

(Inherited from DbDataAdapter)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。Returns an object that represents a service provided by the Component or by its Container.

(Inherited from Component)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
HasTableMappings() HasTableMappings() HasTableMappings() HasTableMappings()

指出是否已經建立 DataTableMappingCollectionIndicates whether a DataTableMappingCollection has been created.

(Inherited from DataAdapter)
InitializeBatching() InitializeBatching() InitializeBatching() InitializeBatching()

初始化 DbDataAdapter 的批次處理。Initializes batching for the DbDataAdapter.

(Inherited from DbDataAdapter)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OnFillError(FillErrorEventArgs) OnFillError(FillErrorEventArgs) OnFillError(FillErrorEventArgs) OnFillError(FillErrorEventArgs)

引發 FillError 事件。Raises the FillError event.

(Inherited from DbDataAdapter)
OnRowUpdated(RowUpdatedEventArgs) OnRowUpdated(RowUpdatedEventArgs) OnRowUpdated(RowUpdatedEventArgs) OnRowUpdated(RowUpdatedEventArgs)

引發 .NET Framework 資料提供者的 RowUpdated 事件。Raises the RowUpdated event of a .NET Framework data provider.

(Inherited from DbDataAdapter)
OnRowUpdating(RowUpdatingEventArgs) OnRowUpdating(RowUpdatingEventArgs) OnRowUpdating(RowUpdatingEventArgs) OnRowUpdating(RowUpdatingEventArgs)

引發 .NET Framework 資料提供者的 RowUpdating 事件。Raises the RowUpdating event of a .NET Framework data provider.

(Inherited from DbDataAdapter)
ResetFillLoadOption() ResetFillLoadOption() ResetFillLoadOption() ResetFillLoadOption()

FillLoadOption 重設為其預設狀態,並讓 Fill(DataSet) 接受 AcceptChangesDuringFillResets FillLoadOption to its default state and causes Fill(DataSet) to honor AcceptChangesDuringFill.

(Inherited from DataAdapter)
ShouldSerializeAcceptChangesDuringFill() ShouldSerializeAcceptChangesDuringFill() ShouldSerializeAcceptChangesDuringFill() ShouldSerializeAcceptChangesDuringFill()

判斷是否應該保存 AcceptChangesDuringFill 屬性。Determines whether the AcceptChangesDuringFill property should be persisted.

(Inherited from DataAdapter)
ShouldSerializeFillLoadOption() ShouldSerializeFillLoadOption() ShouldSerializeFillLoadOption() ShouldSerializeFillLoadOption()

判斷是否應該保存 FillLoadOption 屬性。Determines whether the FillLoadOption property should be persisted.

(Inherited from DataAdapter)
ShouldSerializeTableMappings() ShouldSerializeTableMappings() ShouldSerializeTableMappings() ShouldSerializeTableMappings()

判斷一個或多個 DataTableMapping 物件是否存在並且應該保存 (Persist)。Determines whether one or more DataTableMapping objects exist and they should be persisted.

(Inherited from DataAdapter)
TerminateBatching() TerminateBatching() TerminateBatching() TerminateBatching()

結束 DbDataAdapter 的批次處理。Ends batching for the DbDataAdapter.

(Inherited from DbDataAdapter)
ToString() ToString() ToString() ToString()

傳回任何包含 Component 名稱的 StringReturns a String containing the name of the Component, if any. 不應覆寫此方法。This method should not be overridden.

(Inherited from Component)
Update(DataRow[]) Update(DataRow[]) Update(DataRow[]) Update(DataRow[])

針對 DataSet 的指定陣列中每個插入、更新或刪除的資料列,執行個別的 INSERT、UPDATE 或 DELETE 陳述式,以更新資料庫中的值。Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array in the DataSet.

(Inherited from DbDataAdapter)
Update(DataRow[], DataTableMapping) Update(DataRow[], DataTableMapping) Update(DataRow[], DataTableMapping) Update(DataRow[], DataTableMapping)

針對 DataSet 物件的指定陣列中每個插入、更新或刪除的資料列,執行個別的 INSERT、UPDATE 或 DELETE 陳述式,以更新資料庫中的值。Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array of DataSet objects.

(Inherited from DbDataAdapter)
Update(DataSet) Update(DataSet) Update(DataSet) Update(DataSet)

針對指定之 DataSet 中的每個插入、更新或刪除的資料列,執行個別的 INSERT、UPDATE 或 DELETE 陳述式,以更新資料庫中的值。Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet.

(Inherited from DbDataAdapter)
Update(DataSet, String) Update(DataSet, String) Update(DataSet, String) Update(DataSet, String)

針對具有指定 DataTable 名稱之 DataSet 中的每個插入、更新或刪除的資料列,執行個別的 INSERT、UPDATE 或 DELETE 陳述式,以更新資料庫中的值。Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet with the specified DataTable name.

(Inherited from DbDataAdapter)
Update(DataTable) Update(DataTable) Update(DataTable) Update(DataTable)

針對指定之 DataTable 中的每個插入、更新或刪除的資料列,執行個別的 INSERT、UPDATE 或 DELETE 陳述式,以更新資料庫中的值。Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataTable.

(Inherited from DbDataAdapter)

欄位

DefaultSourceTableName DefaultSourceTableName DefaultSourceTableName DefaultSourceTableName

資料表對應之 DataAdapter 物件所使用的預設名稱。The default name used by the DataAdapter object for table mappings.

(Inherited from DbDataAdapter)

適用於

另請參閱