private void comboBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { comboBox.Refresh(); 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(); da.Fill(dt); for (int i = 0; i < dt.Rows.Count; i++) { comboBox.Items.Add(dt.Rows[i]["BookID"]); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)