Hi Group,
I'm attempting to build a Visual Basic.net application that will gather it's information from our database. My first task is to import to the application a list of rate plans into a combo box for the end user to search and select. I've attempted the following VB.net commands to do this:
Note: I'm using Visual Studio Express 2015
Dim conn As New Oracle.DataAccess.Client.OracleConnection()
conn.ConnectionString = oraDB
Dim sql As String = "select CRMRATESDW.RP.RP_ID" _
& "from CRMRATESDW.RP" _
& "where CRMRATESDW.RP.PROP_ID in ('" & propID & "')" _
& "And CRMRATESDW.RP.DW_RCRD_STS_CD in ('A')" _
& "Order by CRMRATESDW.RP.RP_ID"
Dim command As New Oracle.DataAccess.Client.OracleCommand(sql, conn)
command.CommandType = CommandType.Text
Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter
Dim ds As New DataSet()
Dim i As Integer = 0
Dim dr As Oracle.DataAccess.Client.OracleDataReader = command.ExecuteReader()
Try
conn.Open()
adapter.SelectCommand = command
adapter.Fill(ds)
cmbxRatePlans.DataSource = ds.Tables(0)
cmbxRatePlans.ValueMember = "PROP_ID"
cmbxRatePlans.DisplayMember = "RP_ID"
adapter.Dispose()
command.Dispose()
conn.Close()
conn.Dispose()
Catch ex As Exception
MessageBox.Show("Can Not open connection ! ")
End Try
The combo box (cmbxRatePlans) is not populating with anything. While I'm not getting a runtime error, it isn't working. Can someone offer a suggesting as to how to properly do this?
In advance, thanks for your help.
Don