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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Sep 26, 2011, 8:19 PM EDT
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
Prabhu RajaRank #861 · 2.6K reputationPosted Sep 26, 2011, 9:39 PM EDT
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
Sam HobbsRank #107 · 20.5K reputationPosted Sep 27, 2011, 11:22 AM EDT
Mahesh ChandRank #1 · 393.3K reputationPosted Sep 27, 2011, 12:57 PM EDT
Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 27, 2011, 6:54 PM EDT
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
Sam HobbsRank #107 · 20.5K reputationPosted Sep 28, 2011, 10:49 AM EDT
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.