Hi
Does anyone know what syntax to use with Mysql 5.0, please look at my code sample below.
UpdateCommand="UPDATE Table1 SET Name= @Name, Address= @Address, Date = @Date, Info = @Info, Phone =@Phone WHERE Id =?"
My issue is that I can't use "WHERE Id=?", I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1. If I change to for example WHERE Id=3, then it works. This is in a gridview and it's impossible for me to set a value. The gridview needs to know by itself what id is selected. I use visual studio 2008 and c#.
Thank you.

1 answers
you have to specify an id value. create an @Id parameter and use it in place of the question mark.
answered 2 years ago by:
2309
60
Thank you for your reply, I have parameters visual studio creates them for me when I drag a gridview to my webform. I found out what was wrong, earlier I had a ms sql database and now I changed it to mysql and I missed that datakeynames="ID" instead of "Id". I got it working. Thank you anyway.