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
ssswamii
NA
180
0
SQL command problem
Sep 29 2003 11:43 AM
Hey all I'm having trouble with SQL commands that contain single quote characters. It seems that single quote characters in a SQL command confuse the darn thing. Example: --------------------------------------- // the text I want to store in the SQL database string text = "Here is a single line quote ' there it was"; string sqlCommand = string.Format("Update myDataTable set Text = '{0}', where (ID = 3456781)", text); --------------------------------------- When I .ExecuteNonQuery(), it will throw an exception telling my I've got bad sql command syntax due to the single quote character in text. It works fine if I take the single quote character out. Now I'm very new to SQL, so I'm probably missing something simple. How do I get around this simple syntax issue? Mr. Chornberger, I'm looking your way. :)
Reply
Answers (
5
)
Binding a CSV to a DataSet
VB.NET Certificate retrieval