Comparison of RecordSet of ADO.NET and ADO

zhaozj2021-02-08  200

Guide: In ADO, we use the object of RECORDSET, and an object DataSet is added in ADO.NET. This paper brief comparison has been a DateSet and Recordset, which is very helpful for beginners from ADO.NET!

Translation finishing: .NET technology network (www.51dotnet.com) 郜 飞

Original source: http://www.database-applications.net/Articles/dotnet4.html

Recordset is a record collection that is connected or disconnected (by using the cursor), which is defined as a data sheet. DataSet is a disconnected record collection that can be used as a data set used in memory.

Recordset and data providers are related to: Some data providers do not support some method and features of some Recordset. Instead, DataSet's different methods such as queries, sort, screening, and updates are independent of the data provider.

When the new version of the ADO allows the Recordset to be saved or converted to XML so that the data can be passed to the application and cross the firewall, DataSet does not need to conversion to complete the same task, because DataSet is declared in XML.

Recordset is non-type, meaning that it stores each data as a Variant variable. However, DataSet is a strong type, which stores the data in the original type. Strong type means more standardized programming methods and decreases.

Updating the database is cumbersome, low efficiency and low-power. For example, if there are fifty records to be updated, there is a record that cannot be updated, and the database will reject the entire Recordset. This problem does not exist in DataSet because DataSet can capture errors in a row through its RowError feature. In addition to data, DataSet can also be added or modified its relationships, columns, tables, and similar objects without having multiple database connections.

Finally, in the Recordset, the data is usually taken by a loop. In DataSet, the data view is created and binds to the server control, so the data can be indicated without mixing representation and data access code. This is a very simple programming method.

In short, DataSet and Recordset are completely different. DataSet can be understood as an upgrade of Recordset. In summary, DataSet should be more effective when there is no test and comparison of the RecordSet of ADO.NET's Dataset and ADO.

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

New Post(0)