ADO.NET was designed to meet the needs of a new programming model: disconnected data architecture, tight integration with XML, common data representation with the ability to combine data from multiple and varied data sources, and optimized facilities for interacting with a database, all native to the .NET Framework.The ADO.NET DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the source of the data it contains.
Datasets in Microsoft.Net - RecordSet Objects (Page 2 of 8 )
For example, if you use just the default settings for the ADO Recordset and Connection objects, you cannot get an accurate count of the number of rows in the Recordset. The Recordset object has a Supports method that developers often use to determine the functionality available: Can I modify the contents of the Recordset? If I update a row, will the Recordset send the change to the database immediately or will it be cached? Can I bind my Recordset to a grid? Can I move to the previous row?
The reason that not all Recordset objects support the same functionality is that the Recordset object tries to be everything to everyone. Whether you’re working with a firehose cursor, a server-side cursor, or disconnected data in ADO, you’re using a Recordset object.
Creating a DataSet
As New DataSet("DataSetName") Console.WriteLine(ds.DataSetName)
= new DataSet("DataSetName"); Console.WriteLine(ds.DataSetName);
Filling the DataSet Object
Filling the data from database into dataset object is a very easy process. Here we can use either SQL query or a stored procedure. Below is the example of how to fill data using query.
, strSQL As String strConn = "Provider=SQLOLEDB;Data Source=(local)NetSDK;" & _ "Initial Catalog=Northwind;Trusted_Connection=Yes;" strSQL = "SELECT CustomerID, CompanyName, ContactName, Phone " & _ "FROM Customers" Dim da As New OleDbDataAdapter(strSQL, strConn) Dim ds As New DataSet() da.Fill(ds, "Customers")