1
Answer

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

prashant wamane

prashant wamane

12y
2.8k
1
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)