VB net table adapter insert query not working

264 views Asked by At

Update query on the same table (table adapter) works just fine but in a an insert query i get this error:

Command parameter[2] " data value could not be converted for reasons other than sign mismatch or data overflow.

This is the query from the tableadapter:

INSERT INTO CurrencyRate(CurrencyRateID, CurrencyCode, ValidFromDate, ValidToDate, EnteredBy, Rate, DeptID, ExportMarker) VALUES        (?, ?, '9/6/2015', '12/31/2099', 1, ?, 1, 1)

This is the (part)code from the form:

If currencyAttribute <> "USD" Then
                Try
                    'MsgBox("insert into = " & NewPK & " / " & currencyAttribute & " / " & frDate & " / " & toDate & " / " & rateAttribute)
                    scalarQueriesTableAdapter.InsertIntoCurrency(NewPK, currencyAttribute, rateAttribute)
                Catch ex As Exception
                    MsgBox("Error occured when inserting new line into currencyrate table." _
                          & vbNewLine & vbNewLine _
                          & ex.Message)
                End Try
            End If

Tried my best to diagnose which parameter cant' get in. All parameters seem fine ... ?!?!?!???

0

There are 0 answers