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
NeCroFire
NA
86
0
Save to database problem
Sep 25 2007 10:52 AM
It's a Acces database and I store file names in it.
This is my Command text:
insert.CommandText = "INSERT INTO CompleteListTable(Source, [File Name], [File Size], [Creation Date], Directory)VALUES('" + ListTable.Rows[i].Cells[y].Value.ToString() + "','" + ListTable.Rows[i].Cells[y + 1].Value.ToString() + "','" + ListTable.Rows[i].Cells[y + 2].Value.ToString() + "','" + ListTable.Rows[i].Cells[y + 3].Value.ToString() + "','" + ListTable.Rows[i].Cells[y + 4].Value.ToString() + "')";
It works fine... until there is a "
'
", like in "don
'
t", in the value or some other type of character that can mess up the query... then it gives me an syntax error.
I thought of using these [] brackets before and after each comma, but then I get a "Incorrect use of brackets blah blah..." error.
What am I doing wrong, or what am I missing?
Reply
Answers (
2
)
Uploading files behind the firewalls ..
Flash will not start in Visual Studio 2005