Hi
What is the role of DataSet in ADO.NET?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Sep 28, 2011, 2:49 PM
Note that I meant to add to what Pravin said, since a DataSet can contain data from many possible sources, not just ResultSets of a SqlCommand or Adapter.
Satyapriya NayakPosted Sep 27, 2011, 10:54 PM
Dataset:- It is a disconnected ,Cached set of records.It may be called as a virtual database which contains tables,rows,columns.It is of two types
Typed dataset and untyped dataset
Typed dataset:- It has an associated xml schema.We can insert additional columns in the typed dataset.
Untyped dataset:- It doesnot have an associated xml schema.We cannot insert additional columns here.
Thanks
Mahesh ChandPosted Sep 27, 2011, 4:57 PM
Sam HobbsPosted Sep 27, 2011, 3:22 PM
Prabhu RajaPosted Sep 27, 2011, 1:39 AM
The ADO.NET Dataset is a memory-resident representation of data that provides a consistent relational programming model regardless of the source of the data it contains. A DataSet represents a complete set of data including the tables that contain, order, and constrain the data, as well as the relationships between the tables.
For more refernce : http://msdn.microsoft.com/en-us/library/ss7fbaez(v=vs.80).aspx
Thank You
Pravin MorePosted Sep 27, 2011, 12:19 AM
Role of DataSet is to store multiple resultsets in the form of tables.......because many times your SqlCommand or Adapter returns multiple result set so we can store it in DataSet and fetch it one by one ............
e.g
SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROm Categories",myConnection);
DataSet ds = new DataSet();
ad.Fill(ds,"Categories");
DataTable dt = ds.Tables["Categories"];
Thanx,hope it will help you.
Pravin