Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   Data Bounding (http://www.programmingforums.org/showthread.php?t=1103)

shylesh Nov 11th, 2004 4:40 AM

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

Xyler Dec 13th, 2004 3:00 AM

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.

bunker Dec 16th, 2004 5:53 AM

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