A DataSet contains rows, columns,primary keys, constraints, and relations with other DataTable objects. The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source.
We can use Dataset in combination with SqlDataAdapter Class . Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter. The SqlDataAdapter object allows us to populate Data Tables in a DataSet.
vb.netDim adapter As New SqlDataAdapter(sql, connection)adapter.Fill(ds)
SqlDataAdapter adapter = new SqlDataAdapter(sql,connection );adapter.Fill(ds);
The following ASP.NET program retrieve publishers name from publisher table using a Dataset.
Default.aspx
Untitled Page
Click the following links to see full source code
C# Source Code
VB.NET Source Code
ASP.NET Dataset - Related Contents
Advertisement
ASP.NET Related Topics