These are very simple steps to create and connect an Access database in C#.

  1. cmd.CommandText = "insert into student values(" + this.textBox1.Text + ",'" + this.textBox2.Text + ",'" + this.textBox3.Text + ",'" + this.textBox4.Text + "');";
  2. int temp = cmd.ExecuteNonQuery();
  3. if (temp > 0)
  4. {
  5. MessageBox.Show("Record Added");
  6. }
  7. else
  8. {
  9. MessageBox.Show("Record not Added");
  10. }
  11. mycon.Close();