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
Oyetoke Toby
NA
116
315.9k
Error - Insert data into Access database in c#
Jul 11 2016 5:25 AM
Pls, am having an error code when inserting data into Access database. It keeps saying there's sytank error in my INSERT INTO statement. Can any one help me to solve this.
Here is the code
try
{
OleDbConnection connection =
new
OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\Users\DELL\Documents\EmployeesData.accdb;
Persist Security Info =
false
;");
connection.Open();
OleDbCommand cmd =
new
OleDbCommand(
"insert into EmployeeInfo (UserName, Password)values('"
+ UserText.Text +
"', '"
+ PassText.Text +
"')"
, connection);
cmd.ExecuteNonQuery();
MessageBox.Show(
"Inserted"
);
}
catch
(Exception ex)
{
MessageBox.Show(
"Failed"
+ ex.ToString());
}
Reply
Answers (
11
)
How to convert Binary Data to PDF file when click on Button
What is the logic when we make copy of copy