I have a datagridview in form1, the user selects a row and relevant details are sent to the correlating textboxes in form2. from here the user clicks a button which should update a cell in the row selected (in the database) and change it to 'In production'(which is the orderstatus textbox.
I want to be able to update a row which correlates to the customer ID, which is a primary key in the database... currently the software updates everything within the database table ...
I have tried to debug it i cannot see the error
MAcon.Open();
OleDbCommand cm = new OleDbCommand("UPDATE [Customer Orders] SET [Order Status]=@OrderStatus WHERE [CustomerID]=@CustomerID", MAcon);
cm.Parameters.AddWithValue("@OrderStatus", textBox4.Text);
cm.Parameters.AddWithValue("@CustomerID", CustID.Text);
cm.ExecuteNonQuery();
MAcon.Close();
What I have tried:
MAcon.Open();
OleDbCommand cm = new OleDbCommand("UPDATE [Customer Orders] SET [Order Status]=@OrderStatus WHERE [CustomerID]=@CustomerID", MAcon);
cm.Parameters.AddWithValue("@OrderStatus", textBox4.Text);
cm.Parameters.AddWithValue("@CustomerID", CustID.Text);
cm.ExecuteNonQuery();
MAcon.Close();