ADO This article outlines the latest features of the ado.net2.0 in the. NET Framework 2.0. Some simple examples will be included in the following descriptions to discuss the details of these features.
The following are the new features of Ado.net:
1. Bulk copy operation (Bulk copy Operation)
The bulk copying of data from one data source to another is a new feature of Ado.net 2.0. The bulk copy class provides the quickest way to migrate data from one data source to another. Each ado.net data provider will provide the appropriate batch replication class. For example, in the Sql.net data provider, the bulk copy operation is done by a class called SqlBulkCopy, which can read a dataset, DataTable, DataReader, or XML object.
2. Batch update (Batch update)
If the database server supports the bulk update feature, Batch update replaces several short period submission requests, thus greatly improving the performance of multiple batch updates to the server during a short period of time. The UpdateBatchSize property provides the number of rows to update in a batch of updates. This attribute value can be limited to decimal places.
3. Data paging
The command object now has a new execution method called Executepagereader. This method has three parameters--commandbehavior, StartIndex, and PageSize. If you want to get the number of rows of data to be 101-200, you can easily complete this function by calling this method to set startindex to 101 and pagesize 100.
4. Data connection (Connection) details
Now you can get a connection with more information by setting the Statisticsenabled property of the connection to true. The Connection object provides two new methods--retrievestatistics and Resetstatistics. The Retrievestatistics method returns a Hashtable object to populate the connection information, such as data transfer, user details, travel-marked detail, caching information, and transaction processing.
5.dataset.remoringformat Property
When Dataset.remoringformat is set to binary, the serialization format of the dataset replaces the original XML tag format with the binary format, which can significantly improve the performance of serialization and restore serialization operations.
6. Loading (load) and saving (Save) method of DataTable
In previous versions of Ado.net, only the dataset had the load and save methods. The Load method can load data from objects such as XML into a DataSet object, while the Save method can save data to a persistent storage medium. Now the DataTable supports both approaches.
7. New Data controls