Dear Experts
I use following codes to diplay data in combobox
str = "SELECT sno,name,city FROM employees"
cmd = New SqlClient.SqlCommand(str, con)
da = New SqlClient.SqlDataAdapter(cmd)
dt = New DataTable
da.Fill(dt)
With ComboBox1
.DataSource = dt
.DisplayMember = "name"
.ValueMember = "sno"
.SelectedIndex = 0
End With
Table has three fields as sno,name,city
Combobox displays name column
and data in table is as
sno--name-----city
1-------a------london
2-------b------moscow
3-------c-------tehran
Supose combobox text=a then
I want to display following corresponding data in textbox1 and textbox2
textbox1.text=1
textbox2.text=london
(the first row of data)
please help
I use following codes to diplay data in combobox
str = "SELECT sno,name,city FROM employees"
cmd = New SqlClient.SqlCommand(str, con)
da = New SqlClient.SqlDataAdapter(cmd)
dt = New DataTable
da.Fill(dt)
With ComboBox1
.DataSource = dt
.DisplayMember = "name"
.ValueMember = "sno"
.SelectedIndex = 0
End With
Table has three fields as sno,name,city
Combobox displays name column
and data in table is as
sno--name-----city
1-------a------london
2-------b------moscow
3-------c-------tehran
Supose combobox text=a then
I want to display following corresponding data in textbox1 and textbox2
textbox1.text=1
textbox2.text=london
(the first row of data)
please help