19.4. DataSets

DataSets provide a disconnected in-memory representation of a structure that closely mimics the underlying RDBMS tables. A DataSet object can be used to load data and save data to an RDBMS, and it's even powerful enough to programmatically generate an entire database complete with table, view, and constraint definitions. DataSet is conceptually similar to JDBC's RowSet and CachedRowSet classes.

19.4.1. Loading Data into a DataSet

Listing 19.8 shows how to load data into a DataSet object.

Listing 19.8. Loading Data into a DataSet (C#)
 using System; using System.Data; using System.Data.OleDb; using System.Data.SqlClient; class Test { public static void Main(string[] args) { ReadDataSet(); } private static void ReadDataSet() { SqlConnection ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.