DataAdapter Classe
Definição
public ref class DataAdapter : System::ComponentModel::Component, System::Data::IDataAdapter
public ref class DataAdapter abstract : System::ComponentModel::Component, System::Data::IDataAdapter
public class DataAdapter : System.ComponentModel.Component, System.Data.IDataAdapter
public abstract class DataAdapter : System.ComponentModel.Component, System.Data.IDataAdapter
type DataAdapter = class
inherit Component
interface IDataAdapter
Public Class DataAdapter
Inherits Component
Implements IDataAdapter
Public MustInherit Class DataAdapter
Inherits Component
Implements IDataAdapter
- Herança
- Derivado
- Implementações
Comentários
O DataAdapter serve como uma ponte entre um DataSet e uma fonte de dados para recuperar e salvar dados.The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. O DataAdapter fornece essa ponte por mapeamento Fill , que altera os dados no DataSet para corresponder aos dados na fonte de dados e Update , que altera os dados na fonte de dados para corresponder aos dados no DataSet .The DataAdapter 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.
Se você estiver se conectando a um banco de dados SQL Server, poderá aumentar o desempenho geral usando o SqlDataAdapter junto com seus SqlCommand objetos associados e SqlConnection .If you are connecting to a SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection objects. Para obter OLE DB-fontes de dados com suporte, use o DataAdapter com seus OleDbCommand objetos associados e OleDbConnection .For OLE DB-supported data sources, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects. Para fontes de dados com suporte ODBC, use o DataAdapter com seus OdbcCommand objetos associados e OdbcConnection .For ODBC-supported data sources, use the DataAdapter with its associated OdbcCommand and OdbcConnection objects. Para bancos de dados Oracle, use o DataAdapter com seus OracleCommand objetos associados e OracleConnection .For Oracle databases, use the DataAdapter with its associated OracleCommand and OracleConnection objects.
Quando uma instância do DataAdapter é criada, as propriedades de leitura/gravação são definidas como valores iniciais.When an instance of DataAdapter is created, the read/write properties are set to initial values. Para obter uma lista desses valores, consulte o DataAdapter Construtor.For a list of these values, see the DataAdapter constructor.
Construtores
| DataAdapter() |
Inicializa uma nova instância de uma classe DataAdapter.Initializes a new instance of a DataAdapter class. |
| DataAdapter(DataAdapter) |
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. |
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. |
| AcceptChangesDuringUpdate |
Obtém ou define se AcceptChanges() é chamado durante um Update(DataSet).Gets or sets whether AcceptChanges() is called during a Update(DataSet). |
| 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. |
| 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) |
| 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. |
| 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. |
| 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. |
| ReturnProviderSpecificTypes |
Obtém ou define se o método |
| 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. |
Métodos
| CloneInternals() |
Obsoleto.
Obsoleto.
Obsoleto.
Cria uma cópia dessa instância do DataAdapter.Creates a copy of this instance of 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) |
| CreateTableMappings() |
Cria um novo DataTableMappingCollection.Creates a new DataTableMappingCollection. |
| 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 DataAdapter e opcionalmente libera os recursos gerenciados.Releases the unmanaged resources used by the DataAdapter 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) |
| Fill(DataSet) |
Adiciona ou atualiza linhas no DataSet para correspondência na fonte de dados.Adds or refreshes rows in the DataSet to match those in the data source. |
| 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. |
| 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. |
| 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. |
| FillSchema(DataSet, SchemaType) |
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, IDataReader) |
Adiciona um DataTable ao DataSet especificado.Adds a DataTable to the specified DataSet. |
| FillSchema(DataTable, SchemaType, IDataReader) |
Adiciona um DataTable ao DataSet especificado.Adds a DataTable to the specified DataSet. |
| 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. |
| 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) |
Chamado quando ocorre um erro durante um |
| 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. |
| ShouldSerializeAcceptChangesDuringFill() |
Determina se a propriedade AcceptChangesDuringFill deve ser persistida.Determines whether the AcceptChangesDuringFill property should be persisted. |
| ShouldSerializeFillLoadOption() |
Determina se a propriedade FillLoadOption deve ser persistida.Determines whether the FillLoadOption property should be persisted. |
| 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. |
| 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(DataSet) |
Chama as respectivas instruções INSERT, UPDATE ou DELETE para cada linha inserida, atualizada ou excluída no DataSet especificado em um DataTable denominado “Tabela.”Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet from a DataTable named "Table." |
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. |
Implantações explícitas de interface
| 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. |