![]() |
I have a combobox in my form which shows the employee names.If I select one of the names from it I want its corresponding employee id stored in the database.How can I do this?Please help me.Thanks in advance
|
You can either bind all the items on the form including the combo box or you can use a SQL statement. You then manually add the information to the components on the form. The SQL statement will be as a normal SQL statement except at the end you will have WHERE empName='" & addVarNameHere & "';". This might not be the best way, but it is a way.
|
ComboBox.DataSource = Employees // SomeArrayof employees(ArrayList, Array, Collection)
ComboBox.Displaymember = EmployeeName ComboBox.ValueMember = EmployeeId if you call ComboBox.SelectedValue you will get employee Id value |
| All times are GMT -5. The time now is 12:44 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC