A dataset is an ADO.NET concept. A recordset is an ADO concept. In many ways an ADO recordset is the functional equivalent of an ADO.Net dataset as they are both data containers responsible for holding data.
A recordset resembles a single table. A dataset is a collection of one or tables than can contain relationships analogous to foreign keys in a database.
A dataset is designed to work best in disconnected scenarios which tend to offer better performance since connections are only open long enough to perform a database operation. Even though a recordset can support disconnected access it is primarily designed for connected scenarios.
Transmitting an ADO.NET dataset between applications is easier than transmitting an ADO disconnected recordset. To transmit an ADO disconnected recordset from one component to another, you must use COM marshalling. To transmit data in ADO.NET, you use a dataset, which can transmit an XML stream. XML streams offer better performance; support richer data types and can pass through firewalls easily.
A dataset is easy to navigate as it stores rows as collections which can be accessed in the same way as any collection. A recordset is less flexible; it can only be accessed sequentially using the MoveNext method.
Recordsets can be useful when dealing with legacy COM components. ADO recordsets were used extensively in C++ and VB 6.0 prior to the release of the .Net framework.
Within .Net datasets are used extensively by the Microsoft Data Access Application Block.
You must log in to post a comment.