Ten new characteristics of ado.net2.0

Source: Internet
Author: User
Tags copy new features serialization
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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.