0

Hi,

I have problem, i have designed a web page in asp.net 3.5. I have a TextBox and a button, the User is expected to write some comment in the TextBox. The TextBox can also have a comment pattern including a (') on the click of button the data in the TextBox will be inserted into SQL.

Now the problem is : as you know that if u insert something in Varchar it has to be enclosed in ('), but in above case due to (') in the string itself there will be an error

So, is there a way to insert the data in SQL.

Thanks
Pankaj

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Kusno
0

Using Stored Procedure

or

use my way, replace ' to ` :$

TextBox1.Text = Replace(TextBox1.Text,"'","`")
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.