TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carmen
NA
11
0
apostraphe SQLexception
Jul 24 2009 2:47 PM
I'm inserting and retreiving values from and SQL table to an ASP.net web application.
For inserting values i used
.Replace(
"'"
,
"''"
) to replace apostraphe's.
As a test I inserted
strawberries'
as a value and this worked. But when I try to retrieve this record using an SqlDataReader, i get a SQL exception message as follows:
Unclosed quotation mark after the character string 'strawberries''. Incorrect syntax near 'strawberries''.
The sql command I am using in the command.ExecuteReader() appears as follows:
"select * from table where fieldname = 'strawberries''"
How do I correct this error?
Reply
Answers (
1
)
Report.rdlc not displaying parameterized report
Need guidance