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
rashmi kc
NA
113
159.2k
combobox syntax
Jul 15 2012 12:11 PM
I am getting an error like Syntax error (comma) in query expression 'marks,chaptername='2''Electromagnetic Induction''.
what query i should write to select from both combomarks and combochapters and display the set of questions the particular chapters accoding to the marks selected in c#?
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
checkedListBox2.Items.Clear();
//cmbosubject.Items.Clear();
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\easyexamdb.mdb");
con.Open();
str = "select * from tblmcq where marks,chaptername='" + comboBox1.Text + "''" + checkedListBox1.SelectedItem + "'";
com = new OleDbCommand(str, con);
OleDbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
checkedListBox2.Items.Add(reader["question"]); //.ToString());
}
con.Close();
reader.Close();
}
Reply
Answers (
4
)
combo
Tab Control in WIndows form application