Are there escape characters for SQL?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think it is a very simple question, but i don't know the answer. I am
developing a web site in C# and ASP.NET . If an entry like "Here is Sam's
Pub" is entered into a Textbox exception occurs. Since " ' " character causes
problem. Are there any escape character? Or how can i solve this problem?
 
basulasz,

One option is to replace the single-quote character with 2 single-quote
characters.

Another option is to supply the data as parameters to the sql statement.

I think that using parameters is the way to go whenever possible.

Kerry Moorman
 
Back
Top