| | |
Problem with sending (') in string
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2009
Posts: 28
Reputation:
Solved Threads: 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
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
0
#2 Oct 23rd, 2009
Using Stored Procedure
or
use my way, replace ' to `
or
use my way, replace ' to `

ASP.NET Syntax (Toggle Plain Text)
TextBox1.Text = Replace(TextBox1.Text,"'","`")
NEVER NEVER NEVER GIVE UP
![]() |
Similar Threads
- Problem sending Unicode in C++ (C++)
- Winsock Sending problem (Visual Basic 4 / 5 / 6)
- Problem in Sending Images Thru Mail (ASP.NET)
- MScomm send problem (Visual Basic 4 / 5 / 6)
- getattr function (Python)
- Problem formating VB string for clipboard (Visual Basic 4 / 5 / 6)
- Problem While Processing A String List (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: Trouble with ASP.NET on Vista IIS.
- Next Thread: Problem With Dropdowns, Loops, Databinding and Placeholders
Views: 295 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 activexcontrol advice ajax asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child class click compatible confirmationcodegeneration content contenttype countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdown dropdownmenu edit feedback flash flv folder form forms google grid gridview homeedition hosting identity iframe iis index javascript jquery languages list maps menu mono mssql multistepregistration nameisnotdeclared object objects order problem profile ratings refer rotatepage save search security serializesmo.table session silverlight smartcard sql suse textbox tracking typeof unauthorized update validation vb vb.net video view virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml





