G
Guest
I have a sub that is ran to populate a ComboBox from a database. The code
runs fine except that it doesn't show the first result of the query. What am
I not doing right? The Sub is below.
Thanks for your help
Mike
'Sub
Private Sub GetWeightKitData(ByVal weightClass As String)
'Query the db using the balance data to get the balance Id number
Dim wkSQL As String
'Select BalanceId fo display on the form
wkSQL = "Select Weight_Kit from Tab_Weight_Kit_Details Where
(Balance_Class = '" & weightClass & "') order by Weight_Kit Asc"
'MessageBox.Show(wkSQL)
Me.OraComm.CommandType = CommandType.Text
Me.OraComm.CommandText = wkSQL
Me.OraConn.Open()
Dim drwk As OracleDataReader = OraComm.ExecuteReader()
drwk.Read()
While drwk.Read()
cmbWeightKits1.Items.Add(drwk.Item(0))
cmbWeightKits2.Items.Add(drwk.Item(0))
End While
Me.OraConn.Close()
End Sub
runs fine except that it doesn't show the first result of the query. What am
I not doing right? The Sub is below.
Thanks for your help
Mike
'Sub
Private Sub GetWeightKitData(ByVal weightClass As String)
'Query the db using the balance data to get the balance Id number
Dim wkSQL As String
'Select BalanceId fo display on the form
wkSQL = "Select Weight_Kit from Tab_Weight_Kit_Details Where
(Balance_Class = '" & weightClass & "') order by Weight_Kit Asc"
'MessageBox.Show(wkSQL)
Me.OraComm.CommandType = CommandType.Text
Me.OraComm.CommandText = wkSQL
Me.OraConn.Open()
Dim drwk As OracleDataReader = OraComm.ExecuteReader()
drwk.Read()
While drwk.Read()
cmbWeightKits1.Items.Add(drwk.Item(0))
cmbWeightKits2.Items.Add(drwk.Item(0))
End While
Me.OraConn.Close()
End Sub