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
Felipe Marks
NA
76
0
insert strings using mysql ODBC
Jan 19 2010 3:42 AM
Hi
I have a problem with inserting strings.
I'm using MySql with a ODBC connection.
eg:
code = "mycode";
desc = "It's not working";
string sql = "";
sql = "insert into pasCustomerCodes(code,description) values('" + code + "','" + desc + "')";
OdbcCom = new System.Data.Odbc.OdbcCommand(sql, OdbcCon);
OdbcCom.ExecuteNonQuery();
---------
This gives an erro because of the ' character in the desc string.
Is there anything I can use to fix this?
Thanks
Reply
Answers (
3
)
How to Save the following settings?
Determine what was clicked