i use Database ms Access, and i try to Update some Rows with use parameters like code below
OleDbCommand cmdEditOffline = new OleDbCommand();
cmdEditOffline.CommandText = "UPDATE TbTransactionToOffline SET Amount = @Amount WHERE NoRef = @NoRef";
cmdEditOffline.Connection = conn;
cmdEditOffline.Parameters.Add("@Amount", OleDbType.VarChar).Value = txtAmount.Text;
cmdEditOffline.Parameters.Add("@NoRef", OleDbType.VarChar).Value = label1.Text;`
if (conn.State == ConnectionState.Closed) conn.Open();
cmdEditOffline.ExecuteNonQuery();
this.Close();
i hope is that the data is updated in accordance with the parameters, but instead all data is updated. what wrong?