When i write this code i'm taking
System.Data.OleDb.OleDbException (0x80040E14): Syntax error in UPDATE statement. message.(c#, access(SayacGun, SayacToplam are integers and Tarih is dateTime))
OleDbConnection dbBaglanti2 = new OleDbConnection(VTYolu);
dbBaglanti2.Open();
string Ekle2 = "UPDATE Sys_Sayac SET SayacGun = @Gun, SayacToplam = @Toplam, WHERE Tarih = @Tarih";
OleDbCommand Komut2 = new OleDbCommand(Ekle2, dbBaglanti2);
Komut2.Parameters.AddWithValue("@Gun", int.Parse(OkunanGun));
Komut2.Parameters.AddWithValue("@Toplam", Convert.ToInt32(OkunanToplam) + 1);
Komut2.Parameters.AddWithValue("@Tarih", DateTime.Now.ToShortDateString());
Komut2.ExecuteNonQuery();
dbBaglanti.Close();
You should remove the comma "," before the WHERE clause,
string Ekle2 = "UPDATE Sys_Sayac SET SayacGun = @Gun, SayacToplam = @Toplam WHERE Tarih = @Tarih";
For more information check details of update syntax here
User contributions licensed under CC BY-SA 3.0