I want to update an entire selected same column with another value...
heres a code i have tried, apparently its not working (the error is no changes in DB)
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Rock.accdb";
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = "UPDATE profile SET [year]=@1 WHERE [year]=@2";
cmd.Parameters.AddWithValue("@1", comboBox1.Text);
cmd.Parameters.AddWithValue("@2", comboBox2.Text);
cmd.ExecuteNonQuery();
con.Close();
label4.Text = "Updated successfully";
label4.ForeColor = Color.Green;
Please be respectful, if you guys have any doubts just comment...