prashant wamane

prashant wamane

  • NA
  • 10
  • 37.2k

How to Insert, Delete and Update data to MS Access using BindingNavigator?

Jun 6 2012 6:31 AM
I am using MS Access as my back-end database. I am able to navigate data in textboxes using binding navigator, however not able to insert, delete and update data to the database.
Kindly guide me for the same.
Also, i tried with the following code in "BindingNavigatorAddNewItem_Click"

            OleDbCommand cmd = new OleDbCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "insert into Table1 (name) values (" + textBox1.Text + ")";
            cmd.Connection = mycon;
            mycon.Open();
            cmd.ExecuteNonQuery();
            mycon.Close();

Answers (1)