I have a sql command like this
SqlCommand cmd = new SqlCommand(
"IF NOT EXISTS(SELECT english from dic where english='"+e_word+"') " +
"Insert INTO dic VALUES('"+e_word+"',N'"+b_word+"') " +
"else " +
"UPDATE dic SET english='"+e_word+"',bangla=N'"+b_word+"' WHERE english='"+e_word+"'",con);
cmd.ExecuteNonQuery();
But i m getting error like
Incorrect syntax near 's'.
Incorrect syntax near 's'.
How can i solve this ?????
FTFY:
(actually, I’d usually do my upserts a bit different to that, but I didn’t want to rewrite the entire thing)