By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,633 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,633 IT Pros & Developers. It's quick & easy.

insert data with quotation symbol in asp.net with C#

P: n/a
Hi everyone

i m new here. I have made an web application where user enter message
and clicks on the SUBMIT button. Clickin on the SUBMIT button will
execute a INSERT statement.

Program works fine but if a user enters data with quotation marks in
the text box i.e. "welcome to joe's world.", an error is displayed
since there is a single quotation mark in the text box
joe's .

So please tell me how would I insert data like the above one.

Thnx in advance
Deepak

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You should use ADO.NET parameter objects. They will solve your problem and
they will also protect you from SQL Injection Attacks, which it sounds like
your code is probably vulnerable to at this time.
Here's more info:
http://msdn.microsoft.com/library/de...classtopic.asp

http://msdn.microsoft.com/library/de...isualbasic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"kudeep" <de*****@mzi-dot-net.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
Hi everyone

i m new here. I have made an web application where user enter message
and clicks on the SUBMIT button. Clickin on the SUBMIT button will
execute a INSERT statement.

Program works fine but if a user enters data with quotation marks in
the text box i.e. "welcome to joe's world.", an error is displayed
since there is a single quotation mark in the text box
joe's .

So please tell me how would I insert data like the above one.

Thnx in advance
Deepak

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.