What is DataSet?

The DataSet, which is anin-memory cache of data retrieved from a data source, is a major component ofthe ADO.NET architecture. The DataSet consists of a collection of DataTable objects that you can relate toeach other with DataRelation objects.

A DataSet can read and writedata and schema as XML documents. The data and schema can then be transportedacross HTTP and used by any application, on any platform that is XML-enabled.You can save the schema as an XML schema, and both schema and data can be saved.To read an XML document that includes both schema and data, use the ReadXMLmethod.

Herefirst we will see how we can create dataset:


               DataSet datasetobjectname = new DataSet();  

Herewe can add table in the DataSet:


Herehow we can delete DataTable from dataset:


Setting primary key for a Datatable:

 datatable.PrimaryKey = new DataColumn[] { datatable.Columns['ID']};

Last updated:9/18/2014 1:23:52 PM
John Smith

John Smith

I am best.


Leave Comment