Datasheet

System.Data.SqlClient, which provides the objects used to communicate with SQL Server.
For some of the objects there are two copies – one in the
OleDb namespace, and one in the SqlClient
namespace. For example, there are two Connection objects OleDbConnection and SqlConnection.
Having two objects means they can be optimized for particular databases. Look at figure 8-18 to see how
they relate to each other:
Figure 8-18
On the left we have the database and the connection, in the middle we have four
Command objects, and
on the right a
DataAdapter and a DataSet. Notice that the DataAdapter contains four Command
objects:
SelectCommand, which fetches data.
UpdateCommand, which updates data.
InsertCommand, which inserts new data.
DeleteCommand, which deletes data.
Command
Connection
CommandText
CommandType
Command
Connection
CommandText
CommandType
Command
Connection
CommandText
CommandType
Command
Connection
CommandText
CommandType
DataAdapter
SelectCommand
UpdateCommand
InsertCommand
DeleteCommand
DataSet
Connection
ConnectionString
Database
275
Reading From Databases
57076_Ch 8 SAN.qxd 01/12/2003 6:43 PM Page 275