I am new to handling databases with C# and I want to update a row in the database.
Here is the code:
using (OleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=DPW.MDB;Persist Security Info=True;Jet OLEDB:Database Password=xxxxxx"))
{
connection.Open();
OleDbCommand cmd = connection.CreateCommand();
cmd.Parameters.Add(new OleDbParameter("@googleId", googleID));
cmd.Parameters.Add(new OleDbParameter("@appointmentId", appointmentId));
cmd.CommandText = "UPDATE Appointments SET GoogleId = @googleId WHERE AppointmentId = @appointmentId";
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
The database is not updated after I execute it.