Ado. Introduction to 5 large objects in net
Ado. NET has been in contact with the previous study, and has been applied, but has not been well summed up. Recently this period of study and review this piece of knowledge, below on what I now know summary summed up.
Ado. NET is a new XML-based database access technology, compared with the traditional ADO, its main core z is XML,
It is a disconnected connection that relies primarily on dataset datasets.
First, ADO. NET object model , such as.
. NET The data provider and dataset are two important components of ADO. NET .
. NET Data Provider: guarantees the connection between the client and the server (that is, the connection between the application and the database).
. NET data providers are mainly two, one is the sql.net data provider and the other is OLE DB. NET Data provider.
Sql. NET data provider, which can operate on a SQL Server database.
OLE DB. NET data provider, which can connect to a SQL Server database, and can also connect to a database other than SQL Server.
The Sql.net data provider and OLE DB are described in. NET data provider uses the Connection object, the introduction of namespaces, and the difference between connection string strings.
Second,ADO. An overview of the 5 large objects in net :
(1) Connection object : Connect to the database. the specific connection method, as shown in.
(2) Command object : Execute some simple operation commands, such as: adding and deleting. The T-SQL statement is executed.
Command object in the execution of the time there are several more important methods, such as the ExecuteNonQuery method, to perform additions and deletions to change the command. There are 2 ways to query: One is the ExecuteReader method, and a DataReader object is returned. There is also the Executescale method, which returns the first row column.
(3) DataAdapter Object : Data adapter, Retrieving data from the database, and populating the local data set. at the same time, we can use dataadapterto update the data back from the dataset to the database.
The main 4 command objects used in DataAdapter are important. They were: SelectCommand, InsertCommand, UpdateCommand, DeleteCommand.
SelectCommand, the main is to retrieve data from the database,InsertCommand, UpdateCommand, DeleteCommand these 3 command objects are mainly responsible for the local dataset DataSet data uploaded back to the server.
DataAdapter Fill method for use with DataAdapter The result of the SelectCommand to populate the dataset.
(4) DataReader Object : is a forward-only data stream. Used to retrieve a read-only dataset from the data source and must be connected.
(5) DataSet Object : Is the core of the ADO, equivalent to the local database, it is not related to the database, it and the remote database connection bridge is the . NET data provider. It is composed of multiple tables, each of which is a DataTable object.
The primary object in the DataSet is a DataTable, each column is a DataColumn object, and each row is a DataRow object. Some constraints can be added, one is UniqueConstraint (Unique constraint), and the other is ForeignKeyConstraint (foreign KEY constraint).
There are two important collections under the dataset, one is DataTables and the other is datarelations. all the DataTables inside are DataTable objects.
From the theoretical point of view, this paper outlines the role of 5 large objects in ADO, to better understand the ADO, only in the project to apply it constantly, to realize the deeper.