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
R L
NA
3
1.5k
C# to Access Delete SQL Statement Error
Dec 15 2013 10:10 PM
I have the following DELET Button to delete data from an Access Database but the following SQL Statement is generating this error:
Syntax error (missing operator) in query expression '(Loan Number='5545')'.
Loan Number is a field in the Access DataBase. Thanks
private void button8_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Desktop\Sample.accdb");
con.Open();
OleDbCommand cmd = new OleDbCommand("delete * from DataTable WHERE (Loan Number='" + int.Parse(textBox1.Text)+"')", con);
cmd.ExecuteNonQuery();
con.Close();
}
Reply
Answers (
3
)
Two Timer in One Page
convertion failed