How can I insert ' (Apostrophe) into sql table field ?
Insert Into Table(Field) Values(?)
After executing sql statement above, I want to see ' (apostrope) in field.
Thanks
Replace every single apostrophe with two apsotrophes which "escapes" the apostrophe for eintry into the database.
Also, if you parameterize your query this escaping will be handled for you automatically,
|||Hi Stiletto,
Thanks for your information.If I want to replace 1 apostrophe with 2 apostrophe using with REPLACE command in SQL 2005.
REPLACE(sql expression, 1 apostrope, 2 apostrope)
How can I do this with SQL REPLACE statement.
Thanks
|||I think that you have to escape it before it gets to the SQL engine. So, you'd use the string.Replace() method on your SQL string before building your SqlCommand object.
No comments:
Post a Comment