Saved Bookmarks
| 1. |
Explain about DataSet types in ADO.NET. |
|
Answer» DataSet can be said as a collection of database tables(row and column format) that HOLDS the data. There are two types of DataSet in ADO.NET. They are:
Example program for the usage of DataSet: using System; using System.Data.SqlClient; using System.Data; namespace DataSetDemo { public partial class DataSetExample : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { using (SqlConnection conn = NEW SqlConnection("data source=.; database=employee; integrated security=SSPI")) { SqlDataAdapter DA = new SqlDataAdapter("Select * from employee", conn); DataSet d = new DataSet(); da.Fill(d); GridView1.DataSource = d; GridView1.DataBind(); } } } }Here, DataSet will be filled by DataAdapter that receives data from the employee table. This DataSet will be used to DISPLAY the information received from the employee database. |
|