FryDay_Boy
Newcomer
- Joined
- Jun 10, 2005
- Messages
- 3
Hello all pros and gurus, I have some problems with the combobox, I tried to populate it from an access database but instead I get System.Data.DataRowView in the combobox -_-"
The following is the code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connstring As String
Dim cconnection As OleDbConnection
Dim DistrictAdapter As OleDbDataAdapter
Dim ds_name As New DataSet
connstring = .................
cconnection = New OleDbConnection(connstring)
cconnection.Open()
DistrictAdapter = New OleDbDataAdapter("Select * from [resource master list] where [last name] = '" & TextBox1.Text & "'", cconnection)
DistrictAdapter.Fill(ds_name, "namelor")
ComboBox1.DisplayMember = "first name"
ComboBox1.ValueMember = "employee id"
ComboBox1.DataSource = ds_name.Tables("namelor")
cconnection.Close()
cconnection = Nothing
End Sub
Please HELP ME!!!! Thank you very much
The following is the code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connstring As String
Dim cconnection As OleDbConnection
Dim DistrictAdapter As OleDbDataAdapter
Dim ds_name As New DataSet
connstring = .................
cconnection = New OleDbConnection(connstring)
cconnection.Open()
DistrictAdapter = New OleDbDataAdapter("Select * from [resource master list] where [last name] = '" & TextBox1.Text & "'", cconnection)
DistrictAdapter.Fill(ds_name, "namelor")
ComboBox1.DisplayMember = "first name"
ComboBox1.ValueMember = "employee id"
ComboBox1.DataSource = ds_name.Tables("namelor")
cconnection.Close()
cconnection = Nothing
End Sub
Please HELP ME!!!! Thank you very much