-2

I have seen other version of this problem in stack over flow and when I use it, I get error stating:

"Missing semicolon (;) at end of SQL statement."

I am learning just now C# and I don't know what I am missing, I am using the following commandtext. Suggest me where I am wrong.

"Insert into weightsofsalts(ID,WeightOfSalts) values(@id,@weightofsalts) on duplicate key update WeightOfSalts =@weightofsalts";
Grant Winney
  • 65,241
  • 13
  • 115
  • 165
KamalSubodh
  • 51
  • 2
  • 10

1 Answers1

0

MS Access won't support ON DUPLICATE KEY UPDATE

You have to insert statement first and then check to see if error 3022 occurred, which indicates the row already exists. So you have to update.

Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115