G
Guest
Hi,
I am filling in a combobox. I would like to concatenate two fields into the
data combo box and display "last name, first name"
I tried to displaymember = "employee_last_name" & ", " &
"employee_last_name", but it did not like that.
I can fill the combo box with either the first or the last, but I cannot
manage to concatenate it.
Any suggestions? My code is below.
'fill employee combo box.
strsql = "SELECT * FROM Employee order by employee_last_name"
' Create data adapter object
Dim daEmployee As OleDbDataAdapter = New OleDbDataAdapter(strsql,
TSA.conn)
' Create a dataset object and fill with data using data adapter's
Fill method
Dim dsEmployee As DataSet = New DataSet
daEmployee.Fill(dsEmployee, "Employee")
' Attach dataset's DefaultView to the datagrid control
Dim dvEmployee As DataView = dsEmployee.Tables("Employee").DefaultView
ComboBox5.DataSource = dvEmployee
ComboBox5.DisplayMember = "employee_first_name"
Thanks in Advance!!
Elena
I am filling in a combobox. I would like to concatenate two fields into the
data combo box and display "last name, first name"
I tried to displaymember = "employee_last_name" & ", " &
"employee_last_name", but it did not like that.
I can fill the combo box with either the first or the last, but I cannot
manage to concatenate it.
Any suggestions? My code is below.
'fill employee combo box.
strsql = "SELECT * FROM Employee order by employee_last_name"
' Create data adapter object
Dim daEmployee As OleDbDataAdapter = New OleDbDataAdapter(strsql,
TSA.conn)
' Create a dataset object and fill with data using data adapter's
Fill method
Dim dsEmployee As DataSet = New DataSet
daEmployee.Fill(dsEmployee, "Employee")
' Attach dataset's DefaultView to the datagrid control
Dim dvEmployee As DataView = dsEmployee.Tables("Employee").DefaultView
ComboBox5.DataSource = dvEmployee
ComboBox5.DisplayMember = "employee_first_name"
Thanks in Advance!!
Elena