liquidspaces
Well-known member
This section of code had been working just fine for a good while, when today it started to generate errors during execution. I didnt make any changes that Im aware of and all variables are named as they should be.
I receive the following error: "An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll"
When Ive received this error before its been because the field in the database that I was trying to return was empty. This isnt the case here as the field Im trying to return is present in every database record.
Heres the code. If you need more information please let me know.
I receive the following error: "An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll"
When Ive received this error before its been because the field in the database that I was trying to return was empty. This isnt the case here as the field Im trying to return is present in every database record.
Heres the code. If you need more information please let me know.
Code:
Dim strSelected1 As String = lbDate.SelectedItem
Dim strSelected As String = LBTo.SelectedItem
Dim objDateDataAdapter As New OleDb.OleDbDataAdapter( _
"SELECT BILL_OF_LADING_NUM FROM Shipping WHERE SHIP_TO = " & strSelected & " AND DATE = " & _
strSelected1 & "", OleDbConnection1)
Dim objDateCommand As New OleDb.OleDbCommandBuilder(objDateDataAdapter)
Dim objDateDataSet As New DataSet()
objDateDataSet.Clear()
objDateDataAdapter.FillSchema(objDateDataSet, SchemaType.Source, "Shipping")
objDateDataAdapter.Fill(objDateDataSet, "Shipping") // WHERE THE ERROR OCCURS
lbBOLN.Items.Clear()
Dim i As Integer
Dim strCurrent1 As String
For i = 1 To objDateDataSet.Tables("Shipping").Rows.Count
strCurrent1 = objDateDataSet.Tables("Shipping").Rows(i - 1).Item("BILL_OF_LADING_NUM")
lbBOLN.Items.Add(strCurrent1)
Next
Last edited by a moderator: