Professional Documents
Culture Documents
About DataSet :
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.
About RecordSet:
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.
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();