Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear all,

I want to insert a data text with single quotation(') as like Bachelor's. But could not insert into data field.

Ex:

string description="Bachelor's" or "Admin's";

"insert into details values('+ description +')";

Thanks,

Rezwan
Posted
Updated 5-Sep-10 19:58pm
v2

Use parameterized query instead
Look here[^]

or google to find out how to use parameterized query
 
Share this answer
 
\'
use the escape sequence [^]
 
Share this answer
 
you can use replace function before passing any parameter from your application like this: Replace("Admin's", ",", "")
 
Share this answer
 
Comments
Dalek Dave 7-Sep-10 17:25pm    
A bit long winded

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900