---
title: "DataSet"  
description: "DataSet has been designed for an offline container that means it always works on disconnected mode.ADO.net dataset contains data tables collections an"  
author: "Amit Singh"  
published: 2010-08-30  
updated: 2019-09-23  
canonical: https://www.mindstick.com/articles/121/dataset  
category: "ado.net"  
tags: ["ado.net"]  
reading_time: 1 minute  

---

# DataSet

DataSet has been designed for an offline container that means it always works on disconnected mode.ADO.net dataset contains data tables collections and their relationships it represent a complete set of data including tables that contain tables rows and constraints. Build and fill each data table in a dataset with data from a data source using data adapter.\

Dataset is the collection of the DataTable as figure:

![DataSet](https://www.mindstick.com/mindstickarticle/7f7b7669-603a-4b61-a4d9-5bd3d9f7b861/images/ec65f139-dd6c-4f1f-b169-e2d59defc093.png)

##### The following example shows DataAdapter in c#.

```
//these lines are for creating a new connection by passing server name,uid,password and name of the database as here mind.  SqlConnection con = new SqlConnection("server=abc-pc1\\sqlexpress; uid=sa; password=sa; database=mind");//open connection       con.Open();//create a data adapter and invoking the command.SqlDataAdapter ad = new SqlDataAdapter("select * from Employee", con);//creating dataset objectDataSet ds=new DataSet();ad.fill(ds)//use dataadapter to fill data table //close the connectioncon.Open();
```

---

Original Source: https://www.mindstick.com/articles/121/dataset

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
