Hope you have a unique key in the table "ClassAdmin" & this should work and let me know any error msgs
public partial class Form1 : Form
{
OleDbDataAdapter adpt;
DataSet ds = new DataSet();
public Form1()
{
InitializeComponent();
try
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\\test.mdb;");
adpt = new OleDbDataAdapter("select * from ClassAdmin Order by Class_name", conn);
conn.Open();
adpt.Fill(ds);
OleDbCommandBuilder cbld = new OleDbCommandBuilder(adpt);
dataGridView1.DataSource = ds.Tables[0];
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void button3_Click(object sender, EventArgs e)
{
try
{
adpt.Update(ds);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}