DbDataAdapter Classe

Definição

Ajuda na implementação da interface IDbDataAdapter.Aids implementation of the IDbDataAdapter interface. Os herdeiros de DbDataAdapter implementam um conjunto de funções para fornecer uma tipagem forte, mas herdam a maioria das funcionalidades necessárias para implementar um DataAdapter por completo.Inheritors of DbDataAdapter implement a set of functions to provide strong typing, but inherit most of the functionality needed to fully implement a DataAdapter.

public ref class DbDataAdapter abstract : System::Data::Common::DataAdapter, ICloneable, System::Data::IDbDataAdapter
public ref class DbDataAdapter abstract : System::Data::Common::DataAdapter, ICloneable
public abstract class DbDataAdapter : System.Data.Common.DataAdapter, ICloneable, System.Data.IDbDataAdapter
public abstract class DbDataAdapter : System.Data.Common.DataAdapter, ICloneable
type DbDataAdapter = class
    inherit DataAdapter
    interface IDataAdapter
    interface IDbDataAdapter
    interface ICloneable
type DbDataAdapter = class
    inherit DataAdapter
    interface ICloneable
type DbDataAdapter = class
    inherit DataAdapter
    interface IDbDataAdapter
    interface IDataAdapter
    interface ICloneable
type DbDataAdapter = class
    inherit DataAdapter
    interface IDbDataAdapter
    interface ICloneable
    interface IDataAdapter
Public MustInherit Class DbDataAdapter
Inherits DataAdapter
Implements ICloneable, IDbDataAdapter
Public MustInherit Class DbDataAdapter
Inherits DataAdapter
Implements ICloneable
Herança
Derivado
Implementações

Comentários

A DbDataAdapter classe herda da DataAdapter classe e implementa a IDbDataAdapter interface.The DbDataAdapter class inherits from the DataAdapter class and implements the IDbDataAdapter interface. Ele ajuda uma classe a implementar um DataAdapter projetado para uso com um banco de dados relacional.It helps a class implement a DataAdapter designed for use with a relational database.

Um aplicativo não cria uma instância da DbDataAdapter classe diretamente, mas cria uma instância de uma classe que herda dela.An application does not create an instance of the DbDataAdapter class directly, but creates an instance of a class that inherits from it.

As classes que herdam DbDataAdapter devem implementar os membros herdados e normalmente definem membros adicionais para adicionar funcionalidade específica do provedor.Classes that inherit DbDataAdapter must implement the inherited members, and typically define additional members to add provider-specific functionality. Por exemplo, a DbDataAdapter classe define a SelectCommand propriedade e a DbDataAdapter classe define oito sobrecargas do Fill método.For example, the DbDataAdapter class defines the SelectCommand property, and the DbDataAdapter class defines eight overloads of the Fill method. Por sua vez, a OleDbDataAdapter classe herda o Fill método e também define duas sobrecargas adicionais Fill que usam um objeto Recordset ADO como parâmetro.In turn, the OleDbDataAdapter class inherits the Fill method, and also defines two additional overloads of Fill that take an ADO Recordset object as a parameter.

Notas aos Implementadores

Ao herdar da DbDataAdapter classe, recomendamos que você implemente os seguintes construtores:When you inherit from the DbDataAdapter class, we recommend that you implement the following constructors:

ItemItem DescriçãoDescription
*Prv* DataAdapter ()*Prv* DataAdapter() Inicializa uma nova instância da classe *prv* DataAdapter.Initializes a new instance of the *Prv* DataAdapter class.
*Prv* DataAdapter (comando prv *SelectCommand*)*Prv* DataAdapter(*Prv* Command *selectCommand*) Inicializa uma nova instância da classe *prv* DataAdapter com a instrução SQL SELECT especificada.Initializes a new instance of the *Prv* DataAdapter class with the specified SQL SELECT statement.
*Prv* DataAdapter (cadeia de caracteres *selectCommandText*, Cadeia de caracteres *selectConnectionString*)*Prv* DataAdapter(string *selectCommandText*, string *selectConnectionString*) Inicializa uma nova instância da classe *prv* DataAdapter com uma instrução SQL SELECT e uma cadeia de conexão.Initializes a new instance of the *Prv* DataAdapter class with an SQL SELECT statement and a connection string.
*Prv* DataAdapter (String *selectCommandText*, *prv* Connection *selectConnection*)*Prv* DataAdapter(string *selectCommandText*, *Prv* Connection *selectConnection*) Inicializa uma nova instância da classe *prv* DataAdapter com uma instrução SQL SELECT e um objeto de conexão *prv*.Initializes a new instance of the *Prv* DataAdapter class with an SQL SELECT statement and a *Prv* Connection object.

Para promover a consistência entre .NET Framework provedores de dados, você deve nomear a classe de herança no formato prv DataAdapter, em que prv é o prefixo uniforme fornecido a todas as classes em um namespace de provedor de dados .NET Framework específico.To promote consistency among .NET Framework data providers, you should name the inheriting class in the form Prv DataAdapter, where Prv is the uniform prefix given to all classes in a specific .NET Framework data provider namespace. Por exemplo, "SQL" é o prefixo da SqlDataAdapter classe no namespace System. Data. SqlClient .For example, "Sql" is the prefix of the SqlDataAdapter class in the System.Data.SqlClient namespace.

Construtores

DbDataAdapter()

Inicializa uma nova instância de uma classe DataAdapter.Initializes a new instance of a DataAdapter class.

DbDataAdapter(DbDataAdapter)

Inicializa uma nova instância da classe DataAdapter de um objeto existente do mesmo tipo.Initializes a new instance of a DataAdapter class from an existing object of the same type.

Campos

DefaultSourceTableName

O nome padrão usado pelo objeto DataAdapter para mapeamentos de tabela.The default name used by the DataAdapter object for table mappings.

Propriedades

AcceptChangesDuringFill

Obtém ou define um valor que indica se AcceptChanges() é chamado em um DataRow após ter sido adicionado ao DataTable durante alguma das operações de Preenchimento.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.

(Herdado de DataAdapter)
AcceptChangesDuringUpdate

Obtém ou define se AcceptChanges() é chamado durante um Update(DataSet).Gets or sets whether AcceptChanges() is called during a Update(DataSet).

(Herdado de DataAdapter)
CanRaiseEvents

Obtém um valor que indica se o componente pode acionar um evento.Gets a value indicating whether the component can raise an event.

(Herdado de Component)
Container

Obtém o IContainer que contém o Component.Gets the IContainer that contains the Component.

(Herdado de Component)
ContinueUpdateOnError

Obtém ou define um valor que especifica se uma exceção deve ser gerada quando for encontrado um erro durante uma atualização de linha.Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.

(Herdado de DataAdapter)
DeleteCommand

Obtém ou define um comando para excluir registros do conjunto de dados.Gets or sets a command for deleting records from the data set.

DesignMode

Obtém um valor que indica se o Component está no modo de design no momento.Gets a value that indicates whether the Component is currently in design mode.

(Herdado de Component)
Events

Obtém a lista de manipuladores de eventos que estão anexados a este Component.Gets the list of event handlers that are attached to this Component.

(Herdado de Component)
FillCommandBehavior

Obtém ou define o comportamento do comando usado para preencher o adaptador de dados.Gets or sets the behavior of the command used to fill the data adapter.

FillLoadOption

Obtém ou define o LoadOption que determina como o adaptador preenche o DataTable do DbDataReader.Gets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader.

(Herdado de DataAdapter)
InsertCommand

Obtém ou define um comando usado para inserir novos registros na fonte de dados.Gets or sets a command used to insert new records into the data source.

MissingMappingAction

Determina a ação a ser tomada quando os dados de entrada não têm uma tabela ou coluna correspondente.Determines the action to take when incoming data does not have a matching table or column.

(Herdado de DataAdapter)
MissingSchemaAction

Determina a ação a ser tomada quando o esquema DataSet existente não coincide com os dados de entrada.Determines the action to take when existing DataSet schema does not match incoming data.

(Herdado de DataAdapter)
ReturnProviderSpecificTypes

Obtém ou define se o método Fill deve retornar valores específicos ao provedor ou valores comuns em conformidade com CLS.Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.

(Herdado de DataAdapter)
SelectCommand

Obtém ou define um comando usado para selecionar registros na fonte de dados.Gets or sets a command used to select records in the data source.

Site

Obtém ou define o ISite do Component.Gets or sets the ISite of the Component.

(Herdado de Component)
TableMappings

Obtém uma coleção que fornece o mapeamento mestre entre uma tabela de origem e um DataTable.Gets a collection that provides the master mapping between a source table and a DataTable.

(Herdado de DataAdapter)
UpdateBatchSize

Obtém ou define um valor que habilita ou desabilita o suporte ao processamento de lote e especifica o número de comandos que podem ser executadas em um lote.Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch.

UpdateCommand

Obtém ou define um comando usado para atualizar registros na fonte de dados.Gets or sets a command used to update records in the data source.

Métodos

AddToBatch(IDbCommand)

Adiciona um IDbCommand ao lote atual.Adds a IDbCommand to the current batch.

ClearBatch()

Remove todos os objetos IDbCommand do lote.Removes all IDbCommand objects from the batch.

CloneInternals()
Obsoleto.
Obsoleto.
Obsoleto.

Cria uma cópia dessa instância do DataAdapter.Creates a copy of this instance of DataAdapter.

(Herdado de DataAdapter)
CreateObjRef(Type)

Cria um objeto que contém todas as informações relevantes necessárias para gerar um proxy usado para se comunicar com um objeto remoto.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Herdado de MarshalByRefObject)
CreateRowUpdatedEvent(DataRow, IDbCommand, StatementType, DataTableMapping)

Inicializa uma nova instância da classe RowUpdatedEventArgs.Initializes a new instance of the RowUpdatedEventArgs class.

CreateRowUpdatingEvent(DataRow, IDbCommand, StatementType, DataTableMapping)

Inicializa uma nova instância da classe RowUpdatingEventArgs.Initializes a new instance of the RowUpdatingEventArgs class.

CreateTableMappings()

Cria um novo DataTableMappingCollection.Creates a new DataTableMappingCollection.

(Herdado de DataAdapter)
Dispose()

Libera todos os recursos usados pelo Component.Releases all resources used by the Component.

(Herdado de Component)
Dispose(Boolean)

Libera os recursos não gerenciados usados pelo DbDataAdapter e opcionalmente libera os recursos gerenciados.Releases the unmanaged resources used by the DbDataAdapter and optionally releases the managed resources.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
ExecuteBatch()

Executa o lote atual.Executes the current batch.

Fill(DataSet)

Adiciona ou atualiza linhas no DataSet.Adds or refreshes rows in the DataSet.

Fill(DataSet, Int32, Int32, String)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para corresponder àquelas na fonte de dados usando os nomes DataSet e 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.

Fill(DataSet, Int32, Int32, String, IDbCommand, CommandBehavior)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para corresponder àquelas na fonte de dados usando o DataSet e nomes da tabela de origem, a cadeia de comando e o comportamento do comando.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.

Fill(DataSet, String)

Adiciona ou atualiza linhas no DataSet para corresponder às existentes na fonte de dados usando os nomes DataSet e DataTable.Adds or refreshes rows in the DataSet to match those in the data source using the DataSet and DataTable names.

Fill(DataSet, String, IDataReader, Int32, Int32)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para que correspondam àquelas na fonte de dados usando os nomes DataSet, DataTable e IDataReader.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.

Fill(DataSet, String, IDataReader, Int32, Int32)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para corresponder àquelas na fonte de dados usando os nomes DataSet e 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.

(Herdado de DataAdapter)
Fill(DataTable)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para corresponder àquelas na fonte de dados usando o nome DataTable.Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataTable name.

Fill(DataTable, IDataReader)

Adiciona ou atualiza linhas em uma DataTable para que correspondam àquelas na fonte de dados usando os nomes DataTable e IDataReader especificados.Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable and IDataReader names.

Fill(DataTable, IDataReader)

Adiciona ou atualiza linhas no DataTable para corresponder àquelas na fonte de dados usando o nome DataTable e o IDataReader especificado.Adds or refreshes rows in the DataTable to match those in the data source using the DataTable name and the specified IDataReader.

(Herdado de DataAdapter)
Fill(DataTable, IDbCommand, CommandBehavior)

Adiciona ou atualiza linhas em um DataTable para corresponder às existentes na fonte de dados usando o DataTable, IDbCommand e CommandBehavior especificados.Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable, IDbCommand and CommandBehavior.

Fill(DataTable[], IDataReader, Int32, Int32)

Adiciona ou atualiza as linhas em um intervalo especificado na coleção de objetos DataTable para corresponder àquelas na fonte de dados.Adds or refreshes rows in a specified range in the collection of DataTable objects to match those in the data source.

(Herdado de DataAdapter)
Fill(DataTable[], Int32, Int32, IDbCommand, CommandBehavior)

Adiciona ou atualiza linhas em um intervalo especificado no DataSet para corresponder àquelas na fonte de dados usando os nomes DataSet e 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.

Fill(Int32, Int32, DataTable[])

Adiciona ou atualiza linhas em um DataTable para corresponder àquelas na fonte de dados, começando pelo registro especificado e recuperando até o número máximo de registros.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.

FillSchema(DataSet, SchemaType)

Adiciona um DataTable com o nome “Tabela” ao DataSet especificado e configura o esquema para corresponder a eles na fonte de dados com base no SchemaType especificado.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.

FillSchema(DataSet, SchemaType, IDbCommand, String, CommandBehavior)

Adiciona um DataTable ao DataSet especificado e configura o esquema para corresponder à fonte de dados com base no SchemaType especificado.Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.

FillSchema(DataSet, SchemaType, String)

Adiciona um DataTable ao DataSet especificado e configura o esquema para corresponder à fonte de dados com base nos SchemaType e DataTable especificados.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.

FillSchema(DataSet, SchemaType, String, IDataReader)

Adiciona um DataTable ao DataSet especificado.Adds a DataTable to the specified DataSet.

(Herdado de DataAdapter)
FillSchema(DataTable, SchemaType)

Configura o esquema do DataTable especificado com base no SchemaType especificado.Configures the schema of the specified DataTable based on the specified SchemaType.

FillSchema(DataTable, SchemaType, IDataReader)

Adiciona um DataTable ao DataSet especificado.Adds a DataTable to the specified DataSet.

(Herdado de DataAdapter)
FillSchema(DataTable, SchemaType, IDbCommand, CommandBehavior)

Configura o esquema do DataTable especificado com base no SchemaType, na cadeia de caracteres de comando e nos valores CommandBehavior especificados.Configures the schema of the specified DataTable based on the specified SchemaType, command string, and CommandBehavior values.

GetBatchedParameter(Int32, Int32)

Retorna um IDataParameter de um dos comandos no lote atual.Returns a IDataParameter from one of the commands in the current batch.

GetBatchedRecordsAffected(Int32, Int32, Exception)

Retorna informações sobre uma tentativa de atualização individual dentro de uma atualização em lote maior.Returns information about an individual update attempt within a larger batched update.

GetFillParameters()

Obtém os parâmetros definidos pelo usuário ao executar uma instrução SQL SELECT.Gets the parameters set by the user when executing an SQL SELECT statement.

GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetLifetimeService()
Obsoleto.

Recupera o objeto de serviço de tempo de vida atual que controla a política de ciclo de vida para esta instância.Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Herdado de MarshalByRefObject)
GetService(Type)

Retorna um objeto que representa um serviço fornecido pelo Component ou pelo seu Container.Returns an object that represents a service provided by the Component or by its Container.

(Herdado de Component)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
HasTableMappings()

Indica se um DataTableMappingCollection foi criado.Indicates whether a DataTableMappingCollection has been created.

(Herdado de DataAdapter)
InitializeBatching()

Inicializa o envio em lote para o DbDataAdapter.Initializes batching for the DbDataAdapter.

InitializeLifetimeService()
Obsoleto.

Obtém um objeto de serviço de tempo de vida para controlar a política de tempo de vida para essa instância.Obtains a lifetime service object to control the lifetime policy for this instance.

(Herdado de MarshalByRefObject)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
MemberwiseClone(Boolean)

Cria uma cópia superficial do objeto MarshalByRefObject atual.Creates a shallow copy of the current MarshalByRefObject object.

(Herdado de MarshalByRefObject)
OnFillError(FillErrorEventArgs)

Aciona o evento FillError.Raises the FillError event.

OnFillError(FillErrorEventArgs)

Chamado quando ocorre um erro durante um Fill.Invoked when an error occurs during a Fill.

(Herdado de DataAdapter)
OnRowUpdated(RowUpdatedEventArgs)

Gera o evento RowUpdated de um provedor de dados .NET.Raises the RowUpdated event of a .NET data provider.

OnRowUpdating(RowUpdatingEventArgs)

Gera o evento RowUpdating de um provedor de dados .NET.Raises the RowUpdating event of a .NET data provider.

ResetFillLoadOption()

Redefine FillLoadOption para seu estado padrão e faz com que Fill(DataSet) honre AcceptChangesDuringFill.Resets FillLoadOption to its default state and causes Fill(DataSet) to honor AcceptChangesDuringFill.

(Herdado de DataAdapter)
ShouldSerializeAcceptChangesDuringFill()

Determina se a propriedade AcceptChangesDuringFill deve ser persistida.Determines whether the AcceptChangesDuringFill property should be persisted.

(Herdado de DataAdapter)
ShouldSerializeFillLoadOption()

Determina se a propriedade FillLoadOption deve ser persistida.Determines whether the FillLoadOption property should be persisted.

(Herdado de DataAdapter)
ShouldSerializeTableMappings()

Determina se um ou mais objetos DataTableMapping existem e se devem ser persistidos.Determines whether one or more DataTableMapping objects exist and they should be persisted.

(Herdado de DataAdapter)
TerminateBatching()

Encerra o envio em lote para o DbDataAdapter.Ends batching for the DbDataAdapter.

ToString()

Retorna um String que contém o nome do Component, se houver.Returns a String containing the name of the Component, if any. Esse método não deve ser substituído.This method should not be overridden.

(Herdado de Component)
Update(DataRow[])

Atualiza os valores no banco de dados executando as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída na matriz especificada no DataSet.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.

Update(DataRow[], DataTableMapping)

Atualiza os valores no banco de dados executando as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída na matriz de objetos DataSet especificada.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.

Update(DataSet)

Atualiza os valores no banco de dados executando as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída no DataSet especificado.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.

Update(DataSet, String)

Atualiza os valores no banco de dados executando as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída no DataSet com o nome DataTable especificado.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.

Update(DataTable)

Atualiza os valores no banco de dados executando as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída no DataTable especificado.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.

Eventos

Disposed

Ocorre quando o componente é disposto por uma chamada ao método Dispose().Occurs when the component is disposed by a call to the Dispose() method.

(Herdado de Component)
FillError

É retornado quando ocorre um erro durante uma operação de preenchimento.Returned when an error occurs during a fill operation.

FillError

É retornado quando ocorre um erro durante uma operação de preenchimento.Returned when an error occurs during a fill operation.

(Herdado de DataAdapter)

Implantações explícitas de interface

ICloneable.Clone()
Obsoleto.

Cria um novo objeto que é uma cópia da instância atual.Creates a new object that is a copy of the current instance.

IDataAdapter.TableMappings

Indica como uma tabela de origem é mapeada para uma tabela de conjunto de dados.Indicates how a source table is mapped to a dataset table.

(Herdado de DataAdapter)
IDbDataAdapter.DeleteCommand

Obtém ou define uma instrução SQL para excluir registros do conjunto de dados.Gets or sets an SQL statement for deleting records from the data set.

IDbDataAdapter.InsertCommand

Obtém ou define uma instrução SQL usada para inserir novos registros na fonte de dados.Gets or sets an SQL statement used to insert new records into the data source.

IDbDataAdapter.SelectCommand

Obtém ou define uma instrução SQL usada para selecionar registros na fonte de dados.Gets or sets an SQL statement used to select records in the data source.

IDbDataAdapter.UpdateCommand

Obtém ou define uma instrução SQL usada para atualizar registros na fonte de dados.Gets or sets an SQL statement used to update records in the data source.

Aplica-se a