Fjodr Fjodr - 1 year ago 75
Vb.net Question

"Input value not long enough for date format" When updating with TableAdapter

My queries are managed by a

DataAdapter
, so I have little to no control over it's generation.The problem query goes this way:

UPDATE MYSCHEMA.MYTABLE
SET MYDATETIME = :myDateTime
WHERE (MYKEY = :myKey)


The data access layer is automatically generated. I can't change how it works...

The type of
MYDATETIME
in the database side is
Timestamp
.

The type of the parameter
myDateTime
of the
DataAdapter
query and the field from the dataset is
DateTime
.

Not sure if it should matter. Also, it seems that on the Oracle side, the hour is 24 hour but the hour managed by the app has a 12 hour base. But Why would it matter? When calling the update method, I pass
Date.Now
. How more legit could it be?? But it still is rejected with:


ORA-01840: Input value not long enough for date format


Any ideas?

Answer Source

As per comment chat, it seems that a string conversion is occurring because the parameter database type is set to varchar

Set the ProviderType of the parameter to be something more relevant to the type Oracle is expecting - it'll either be Date, DateTime, Timestamp, OracleDateTime or some variation on this theme (the names change according to whether you use .net oracle client or oracle's one) , hopefully...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download