A dataset, also known as a data set, data set, or data set, is a collection composed of data. A Data Set (or dataset) is a collection of data, usually in the form of tables.
DatasetIt does not directly deal with the database. The interaction between the database and the database is provided through. NET data.ProgramThe data adapter object in. How does a dataset work?
1. The application sends a request to the server to obtain data.
2. the server sends the response data to the dataset through the. NET dataset provider.
3. The dataset sends data to the client.
4. The client is modified and stored in the dataset.
5. The dataset saves the modified data to the server.
Working principle of ADO. Net dataset Dataset:
First, the client establishes a connection with the database server.
Then, the client application sends data requests to the database server. After receiving the data request, the database server retrieves and selects the data that meets the condition and sends the data to the client. In this case, the connection can be closed.
Next, the dataset transmits data to the client application in the form of data binding controls or direct reference. If data changes during running of the client application, it modifies the data in the dataset.
When an application is running at a certain stage, for example, if the application needs to save data, you can establish a connection from the client to the database server and submit the modified data in the dataset to the server, the connection is closed again.
This kind of work process that does not require real-time database connection is called for non-connection data access. When processing data in a DataSet object, the client application only uses data copies in the memory of the local machine. This relieves the pressure on the database server and network, because the database server can be connected only when the data is obtained for the first time, edited, and uploaded back to the database.
Although this non-connection-oriented data structure has advantages, there are still problems. When the environment is disconnected, the client application does not know the changes made by other client applications to the original data in the database. It is possible to get outdated information.