using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DataReadingWithDataSet
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
OleDbConnection thisConnection =
new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\360\Programs_managedVCSharp\rnrbooks.mdb");
thisConnection.Open();
OleDbDataAdapter thisAdapter =
new OleDbDataAdapter("SELECT ISBN, Title, Author FROM Books", thisConnection);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "Books");
foreach (DataRow theRow in thisDataSet.Tables["Books"].Rows)
{
displayTextBox.Text +=
theRow["ISBN"] + "\t" + theRow["Title"] + "\t" + theRow["Author"] + "\r\n";
}
thisConnection.Close();
}
}
}