Click here to Skip to main content
15,790,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
I am currently working on C# windows application where I am using MS Access 2003 DB as back end I am trying to get filter data in combo box as example If I put 0 so it should show all 0 started data in the combo box but it doesn't and also under which event of the combo box it will come below I show Code

private void comboBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
            string str = "SELECT BookID FROM BookMaster WHERE BookID like '%" + comboBox.Text + "%'";
            OleDbCommand cmd = new OleDbCommand(str, conn);
            OleDbDataAdapter da = new OleDbDataAdapter();
            da.SelectCommand = cmd;
            DataTable dt = new DataTable();
            for (int i = 0; i < dt.Rows.Count; i++)

but it is not coming as expectation

Thanks & Regards
Indrajit Dasgupta
Updated 29-Jan-12 23:07pm
Rajesh Anuhya 30-Jan-12 4:08am    
pre tags added

1 solution

Check your Query returns values, your DataSet is not empty..
Share this answer
IndrajitDasgupat 30-Jan-12 4:14am    
Data table is not empty but it is not coming filter data which I mentioned above
Rajesh Anuhya 30-Jan-12 4:18am    
Any exception you are getting?
try like this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900