I'm using 2.1 and am updating a record. When I run the update I get the error 'Incorrect syntax near the keyword WHERE'. I've seen this is a bug and I've applied the patch to the SQL2005 generator, regenerated the code and got the same error. I even tried what was referenced here : http://forums.subsonicproject.com/forums/p/3488/14473.aspx#14473. Same issue.
Thoughts on what I'm doing wrong? Code is posted below. Is there an alternate or better way to update a record?
Second question. When doing an update, can I only specify the columns that changed or do I have to specify every column?
Here's the code:
TblContract t = new TblContract();
t.IsNew = false;
t.ContractID = Convert.ToInt32(dsCurrentRecord.Tables[0].Rows[0]["ContractID"].ToString()); //primary key
t.DepartureCity = txtDepartureCity.Text;
t.Save();
I must say that I discovered subsonic earlier this week with the help of a friend and have to say it is AWESOME!!!! Why can't all data connectivity be this easy!!!