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
a.peeringa
NA
1
0
Add parameter value that contains a single quote (C#)
May 23 2005 11:06 AM
I am trying to set a value to a parameter for an OracleCommand object. The SQL statement selects based on the value or set of values contained in the string, e.g. "WHERE work_schedule IN ('CJ','CL','CP')". If I set the value to a string that does not contain a single quote, the query works and I get the expected results. If I pass it a string that contains a single quote, it returns ORA-01403 (no rows found). I have tried preceding each single quote with another single quote, preceding each single quote with a backslash, and trying each of these syntaxes AND preceding the entire string with '@', which according to .net documentation, forces .net to read the string 'verbatim'. NONE of these syntaxes work. I have used parameterized queries in C for years. I am new to C# and .net. There MUST be a way to create and execute a query which searches for multiple values in C#!! I can't believe there isn't. Does anyone know how to do this?? Thanks
Reply
Answers (
2
)
Error updating Access Tables
Excel sheet to DataGrid (using ADO.NET)