H
Harshil
I am developing an application in vb.net and oracle as my database. my
goal is to display the county names (display member) to the user while
store county id (value member) in the combo box. when I run my code I
get county id displayed in the combo box rather than the county names.
When I tried debugging my code I found out the display member and the
value member get assigned the same value i.e ID.
What could possibly be wrong??
code
====================================
Dim Connect As OleDbConnection
Dim DA_County As OleDbDataAdapter
Dim DS_County As New DataSet()
Dim DT_County As New DataTable()
Dim gConnectString as string
gConnectString = "Provider=MSDAORA;" & _
"Data Source=dd;" & _
"User ID=dd; " & _
"Password=dd; "
Connect = New OleDbConnection(gConnectString)
Connect.Open()
DA_County = New OleDbDataAdapter("Select CountyName Name, CountyNo ID
from ipt.tblcounty order by CountyName", Connect)
DA_County.Fill(DS_County)
DT_County = DS_County.Tables(0)
cboCty.ValueMember = "ID"
cboCty.DataSource = DT_County
cboCty.DisplayMember = "Name"
Connect.Close()
Connect = Nothing
goal is to display the county names (display member) to the user while
store county id (value member) in the combo box. when I run my code I
get county id displayed in the combo box rather than the county names.
When I tried debugging my code I found out the display member and the
value member get assigned the same value i.e ID.
What could possibly be wrong??
code
====================================
Dim Connect As OleDbConnection
Dim DA_County As OleDbDataAdapter
Dim DS_County As New DataSet()
Dim DT_County As New DataTable()
Dim gConnectString as string
gConnectString = "Provider=MSDAORA;" & _
"Data Source=dd;" & _
"User ID=dd; " & _
"Password=dd; "
Connect = New OleDbConnection(gConnectString)
Connect.Open()
DA_County = New OleDbDataAdapter("Select CountyName Name, CountyNo ID
from ipt.tblcounty order by CountyName", Connect)
DA_County.Fill(DS_County)
DT_County = DS_County.Tables(0)
cboCty.ValueMember = "ID"
cboCty.DataSource = DT_County
cboCty.DisplayMember = "Name"
Connect.Close()
Connect = Nothing