difference between an ADO.NET Dataset and an ADO Recordset

Posted by Saranya Boopathi under ASP.NET on 6/26/2013 | Points: 10 | Views : 942 | Status : [Member] | Replies : 1
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Saranya Boopathi


Posted by: Satyapriyanayak on: 6/27/2013 [Member] [MVP] Silver | Points: 25

DataSet and Recordset

Recordset represents data in memory, usually it's a table or result of a query such as joining two tables or using where clause. At one time there can be only one current record in Recordset, if you want to perform operations on other record you have to use move method. On the other hand DataSet can contain one or more tables from database, these tables are stored in object called DataTable. It is also very easy to retrieve data from it, you can use simple foreach loop to do so. With DataSet you can also maintain relationships between data tables such as for instance foreign key. Generally DataSet can include more rich and complex data and organize it in a clear manner.

As I mentioned before ADO Recordset requires constant connection to database to perform some operations on it while ADO.NET DataSet allows you to make changes and submit all of them to the database later. ADO.NET uses also data adapter which communicates with OLE DB provider while in ADO you communicate with it directly. Data adapters are significant advantage because it's very easy to set up and manage this connection (you can for instance optimize data transfer for performance)

Also performance of DataSets is better because of its architecture, it's faster and more portable than Recordset.

DataSet stores data in XML so it's easier to transfer it to other applications and they are more firewall-prove than Recordsets that are transferred using COM marshalling.

Summing up DataSet is better and more robust tool to manage data from databases and it provides more functionalities


If this post helps you mark it as answer

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response