You are on page 1of 2

ASSINGMENT

1: Difference between ADO.NET Data Set and ADO Record Set:

About DataSet :

1. ASP.NET DataSet is Designed for disconnected access.

2. Dataset is a data structure which represents the complete table data at same time.

3. Dataset is just a data store and manipulation is done through DataAdapters in .NET.

4. DataSet can contain multiple tables .Retrieving data from more than one table or source does not
require a JOIN.

5. XML like HTML is plaintext: Firewall friendly .

About RecordSet:

1. ADO RecordSet is connected Architecture.

2. RecordSet provides data one row at a time.

3. RecordSet has the logic to update and manipulate data

4. The RecordSet is the central data container. RecordSet is one (1) table that contains all the data

Retrieving data from more than one table or source requires a database JOIN.

5. Problems marshalling through firewalls (DCOM binary)

Main Points of Difference:

1) A DataSet can represent an entire relational database in memory complete with tables relations
and views A RecordSet can not.

2) A DataSet is designed to work without any continuing connection to the original data source;
RecordSet maintains the contentious connection with the original data source.
3) There's no concept of cursor types in a DataSet They are bulk loaded while RecordSet work with
cursors and they are loaded on demand.

4) Datasets have no current record pointer you can use For Each loops to move through the data.
RecordSet have pointers to move through them.

2:DataReader
The SqlDataReader Object
Many data operations require that you only get a stream of data for reading.  The data reader
object allows you to obtain the results of a SELECT statement from a command object.  For
performance reasons, the data returned from a data reader is a fast forward-only stream of data. 
This means that you can only pull the data from the stream in a sequential manner.  This is good for
speed, but if you need to manipulate data, then a DataSet is a better object to work with.

by using dataset

ds = new dataset()
sqlDbAdapter ad = new sqlDbAdapter(sqlquery connobject)
ad.fill(ds tablename)

DataReader

dr = new sqlDataReader()
sqlCommand sqlcmd = new sqlcommand(sqlqry conObject)
dr = sqlcmd.executeReader();

The datareader can be used to forward only. compare to dataset it is faster.


 

By: Deepali Sharma

You might also like