Top ten new features of ADO.NET 2.0 [Translation]

xiaoxiao2021-03-06  54

This article outlines the latest features of ADO.NET 2.0 in .NET Framework 2.0. In the following description, some simple examples will be included to discuss details of these features.

The following is ADO.NET added features:

1. Batch replication operation (Bulk Copy Operation)

Copying data from a data source batch to another data source is a new feature of ADO.NET 2.0. The quantity replication class provides the fastest way to migrate data from one data source to another. Each ADO.NET data provider provides a corresponding batch replication class. For example, in the SQL.NET data provider, the bulk replication 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 bulk update features, Batch Update replaces several short-term submission requests, which greatly improves performance when generating multiple bulk updates in a short cycle. The UpdateBatchSize property provides the number of rows to update in a batch of updates. This attribute value can be limited to a small number.

3. Data page

Now the Command object has a new implementation method called ExecutePageReader. This method has three parameters - Commandbehavior, StartIndex, and Pagesize. If you want to get the number of data lines is 101-200, you can easily complete this feature by calling this method to set STARTINDEX to 101 and PageSize.

4. Data Connection (Connection)

Now you can get more information by setting up the STATISTICSENABLED attribute that connects the connection. The Connection object provides two new methods - RETRIEVESTATISTICS and RESETSTATISTICs. RetrieveStatistics method returns a HashTable object to populate connection information, such as data transfer, user details, cache, cache information, and transaction processing.

5.Dataset.RemoringFormat property

When Dataset.RemoringFormat is set to binary, the serialization format of DataSet has replaced the original XML tag format by the binary format, which can significantly improve the performance of serialization and restore sequence.

6. Loading (LOAD) Method for DataTable

In previous versions of ADO.NET, only DataSet has LOAD and SAVE methods. The LOAD method can load data in an object such as XML to a DataSet object, while the Save method can save data into a persistent storage medium. DataTable is now supporting these two methods.

7. New data control

In the toolbox, you will see the new controls shown in Figure 1 - DataGridView, DataConnector, and DataNavigator. With these controls, you can provide data navigation (pagination) feature in the data binding control.

Figure 1 Data Binding Control

8. DBPROVIDERSFACTORIES class

This class can provide a list of existing data providers in the current machine. When writing a database relying on programs, you can use this class and its members to find the most suitable data provider for your database.

9. Custom data provider (Provider)

By providing factory classes, ADO.NET now expands to support custom data providers. You don't need to write a data provider support code. You can use the data provider base class and the connection string to help you complete these features.

10. DataReader new implementation method

Now the Command object supports more implementation methods, except for the old ExecuteNonQuery, ExecuteReader, ExecuteScaler, and ExecutexmlReader methods, they also add new execution methods, which are: ExecutePageReader, ExecuteResultSet, and ExecuteRow. Figure 2 shows all execution methods supported by the Command object in ADO.NET 2.0. Figure 2 Execution method of Command

to sum up

ADO.NET 2.0 provides developers with many new, improved features to improve performance and reduce code quantity. In this article, I discussed 10 high features of ADO.NET 2.0. In my later articles, I will continue to discuss these features in more detail.

?

? [Note] The first translation, there is a problem, please include me. Original English article address:

http://www.c-sharpcorner.com/code/2004/june/adonet2.0features.asp

Author Blog:

http://blog.9cbs.net/spgoal/

related articles

ADO.NET2.0's top ten new features [Translation] Umbrella and agile development NUnit 2.1 simple implementation. NET test drive development (TDD) Using C # Develop a simple P2P application Visual C # .NET network program development - Socket

转载请注明原文地址:https://www.9cbs.com/read-116568.html

New Post(0)