Fjodr Fjodr - 1 year ago 88 Question

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

My queries are managed by a

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

WHERE (MYKEY = :myKey)

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

The type of
in the database side is

The type of the parameter
of the
query and the field from the dataset is

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
. 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