I am making a Windows Form in that I have A combo box, Into which i have loaded some 'Invoice Numbers', from SQL server 2010. I want to Display Invoice Numbers as the User types into the Combo box. For eg if User types '100' then the Invoice Numbers Starting with '100' should be displayed in the dropdown.
Please Help, Thanks in Advance...
DataTable temp;
DataTable bank;
private void Form1_Load(object sender, EventArgs e)
{
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
temp = DbRdRw.SqlDbRead("Select * from BankMaster", "BankMaster");
DataView dtview = new DataView(temp);
dtview.Sort = "BankName DESC";
bank = dtview.ToTable();
comboBox1.DataSource = bank;
comboBox1.ValueMember = "BankName";
comboBox1.DisplayMember = "BankName";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With