aharris2693
Programmer
I think this is a relatively simple question, but being new to .Net, I don't know the answer to it. I have built a combo box that is filled through a datatable. All of this works, but what I am trying to do is add "PersonID", another field in the datatable as the value of each entry. I tried value member, but that just holds the last one in the set. Below is part of my code, any help would be much appreciated.
Dim MyDataTable As New System.Data.DataTable("EmployeeInfo"
objDA.Fill(MyDataTable)
Dim myDataRow As DataRow
For Each myDataRow In MyDataTable.Rows
strName = Convert.ToString(myDataRow("Expr1"
)
intID = Convert.ToDouble(myDataRow("PersonID"
)
cmbName.DisplayMember = (strName)
Next
Dim MyDataTable As New System.Data.DataTable("EmployeeInfo"
objDA.Fill(MyDataTable)
Dim myDataRow As DataRow
For Each myDataRow In MyDataTable.Rows
strName = Convert.ToString(myDataRow("Expr1"
intID = Convert.ToDouble(myDataRow("PersonID"
cmbName.DisplayMember = (strName)
Next