A strophe (') Problem
I want to update field name with string that includes Astrophe('). When use
ExecuteQuery it gives Error. How to overcome this problem
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nilesh Jagdale14 reputationPosted Jul 27, 2006, 8:36 AM EDT
Update test set name='harsih' where name='san'tosh'
To resolve this just replace the ' with '' in update query
As below
Update test set name='harsih' where name='" + strNewname.ToString().Replace("'","''").Trim() + "'
Thanks and Regards,
Nilesh Jagdale