Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I try to edit or create a user and I want to insert text which has apostrophe it give me error, incorect syntax.
Posted
Comments
[no name] 23-Aug-14 12:54pm    
You would either need to disallow the user from using that character or escape the character when submitting the string to your database.
M-osab 23-Aug-14 13:00pm    
it is a very important caracter so I can't use this solution :D
[no name] 23-Aug-14 13:09pm    
Not it's not all that important and if you cannot prevent the user from using that character OR escape the character when you submit the string to SQL then there really isn't anything else that I know of that you can do.
Sergey Alexandrovich Kryukov 23-Aug-14 23:26pm    
The use of parametrized statements eliminate this rather artificial problem. Why would anyone include the character in the SQL statement.
I will answer in further detail only of OP confirms that SQL is used, or ADO.NET is used with SQL.
—SA
Sergey Alexandrovich Kryukov 23-Aug-14 23:25pm    
This database related question is totally unrelated to WPF. If you are going to use the apostrophe, of course.
—SA

1 solution

I found it
I used this lines :
C#
richTextBox1.SelectAll();
string text = richTextBox1.Selection.Text;

and you can put any character in this richtextbox
Done :D
 
Share this answer
 

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