D
David Fúnez
Hi;
I have a combobox that works ok, it displays the name of the customer
[cliente] in the combobox, but i want to display de Id_customer [id_cliente]
value in a textbox, i tryed this but is not what i want:
** This works ok ***
Dim cmd As SqlCeCommand = cn.CreateCommand
cmd.CommandText = "SELECT id_cliente, nombre FROM clientes ORDER BY nombre"
Dim da As New SqlCeDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
cmbBox.DataSource = ds.Tables(0)
cmbBox.DisplayMember = "Nombre"
cmbBox.ValueMember = "Id_cliente"
** the code to display the id_cliente***
Private Sub cmbBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cmbBox.SelectedIndexChanged
Label4.Text = cmbBox.SelectedIndex.ToString
End Sub
Thanks on advance.
I have a combobox that works ok, it displays the name of the customer
[cliente] in the combobox, but i want to display de Id_customer [id_cliente]
value in a textbox, i tryed this but is not what i want:
** This works ok ***
Dim cmd As SqlCeCommand = cn.CreateCommand
cmd.CommandText = "SELECT id_cliente, nombre FROM clientes ORDER BY nombre"
Dim da As New SqlCeDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
cmbBox.DataSource = ds.Tables(0)
cmbBox.DisplayMember = "Nombre"
cmbBox.ValueMember = "Id_cliente"
** the code to display the id_cliente***
Private Sub cmbBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles cmbBox.SelectedIndexChanged
Label4.Text = cmbBox.SelectedIndex.ToString
End Sub
Thanks on advance.