O'Reilly logo

ADO.NET in a Nutshell by Bill Hamilton, Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comments/Troubleshooting

No reference is maintained between the DataSet, the DataAdapter , and the Connection. After the DataAdapter retrieves data from a data source into a DataSet, the DataSet has no information about the connection, database, tables, columns, or any other details about the source of the data.

Because the DataAdapter is a connected class, each .NET data provider implements its own DataAdapter, with a similar interface and function to other DataAdapter classes but in its own unique namespace. The DataAdapter class namespaces for several ADO.NET data providers are listed in Table 29-1.

Table 29-1. Provider-specific DataAdapter classes

Class

Data source

System.Data.SqlClient.SqlDataAdapter

SQL Server

System.Data.OleDb.OleDbDataAdapter

OLE DB provider

Microsoft.Data.Odbc.OdbcDataAdapter

ODBC driver

System.Data.OracleClient.OracleDataAdapter

Oracle

The commonly used public properties of the DataAdapter class are listed in Table 29-2.

Table 29-2. DataAdapter properties

Property

Description

AcceptChangesDuringFill

Gets or sets a value indicating whether the row is committed when added to a table using the Fill( ) method.

ContinueUpdateOnError

Gets or sets a value indicating whether the DataAdapter should raise an exception and stop processing remaining updates when an error is encountered.

DeleteCommand

Gets or sets the command, either a SQL statement or a stored procedure, that deletes the DataSet records marked for deletion from the data source when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required