Gday all.
So, i can't work out why this code is giving me this OleDbException: "No value given for one or more required parameters"
Any ideas/Pointers?Code:Public Function makeLabels() Dim DA As OleDb.OleDbDataAdapter Dim DS As DataSet = New DataSet("DS") Dim SQL As String Dim xigsm, xserial, eol As String Dim eolDate As Date Dim i As Integer = 0 dbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & cString dbConnection.Open() While i < Macs.Count If Macs(i).getMacType = "2" Or Macs(i).getMacType = "4" Then Try SQL = "SELECT * FROM SMSAssetViewer1 WHERE Barcode = IGSM" & Macs(i).getIGSM DA = New OleDb.OleDbDataAdapter(SQL, dbConnection) DA.Fill(DS, "stuff") xigsm = DS.Tables("stuff").Rows(0).Item("Barcode") xserial = DS.Tables("stuff").Rows(0).Item("SerialNo") eol = DS.Tables("stuff").Rows(0).Item("ClientAcceptedInstallDate") eolDate = CDate(eol) eolDate = DateAdd(DateInterval.Year, 3, eolDate) MessageBox.Show("igsm: " & xigsm & " ||| serial: " & xserial & " ||| eol: " & eolDate.ToString) Catch End Try End If i = i + 1 End While dbConnection.Close() Return 0 End Function![]()




Reply With Quote