5. DataSet
• DataSet Which has Currently Strored Single DataBase Table, and Get
Entire Table structure of Rows and colums in a DataBase Table
• DataSet Fetches multiple row at a time
6. DataTable
• DataTable Which has Currently Strored Single DataBase Table, and Get
Entire Table structure of Rows and colums in a DataBase Table
• Datatable Fetches single row at a time
7. Example :
DataTable dt = new DataTable("Student");
string query = "Select * from Table";
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=(localdb)MSSQLLocalDB;Initial Catalog=ChartDB;Integrated Security=True";
SqlCommand cmd = new SqlCommand();
cmd.CommandText = query;
cmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmd);
con.Open();
da.Fill(dt);
con.Close();
return dt;
In this Program we Datatable for Structure Sqlconnection for connect DataBase Table
sqlcommand to Data Manipulation in DataBase TableSqlDataAdapter it consists of connection and user query and table fill to DataTable