I ve a simple form in C# with Customer details. I used comboBox for CustomerID. How can I select CustomerID from SQL database? and I want once I select customerID in comboBox rest of the text boxes like customer name, phone fills automatically. How can I achieve this?
Populating text fields from database
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

James2 reputationPosted Jul 2, 2008, 5:19 AM EDT
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Jul 2, 2008, 1:21 PM EDT
For selecting CustomerID you can use the following sql statement.
"select CustomerID from tablename"
Now you want to fill all the other textboxes on change of combobox selected item.
To do this you can use combobox SelectedIndexChanged events. Make the autopostback
property true for the combobox.
Glance through the following articles to know more about combobox features:
http://www.codersource.net/asp_net_dropdownlist.html
http://www.aspfree.com/c/a/ASP.NET/ASPNET-Dropdown-List-Control-Eight-Ways-to-Bind-Data/