what is the efficient way to handle apostrophe (') when working with SQL Transact command.
Printable View
what is the efficient way to handle apostrophe (') when working with SQL Transact command.
Escape it using double apostrophe's:
Code:myString = myString.Replace("'", "''");
Use parameterized queries so that the apostrophes are automatically handled.