Using MultiTabled Datasets : OleDbDataAdapter « ADO.Net « C# / CSharp Tutorial






using System;
using System.Data;
using System.Data.OleDb;


class MainClass 
{
  static void Main(string[] args)
  {
    OleDbConnection MyConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source = c:\Northwind.mdb");
    OleDbDataAdapter MyAdapter = new OleDbDataAdapter("SELECT * FROM Orders", MyConnection);
    DataSet MyDataSet = new DataSet();

    MyAdapter.Fill(MyDataSet, "Orders");
    foreach (DataTable MyTable in MyDataSet.Tables)
    {
      foreach (DataColumn MyColumn in MyTable.Columns)
      {
        foreach (DataRow MyRow in MyTable.Rows)
        {
        }
      }
    }
  }
}








32.10.OleDbDataAdapter
32.10.1.Updating a DataSource
32.10.2.Using MultiTabled Datasets
32.10.3.Using ADO Managed Provider