Skip to main content
This is a strange one.

I have a server event with one line of code:

.Value = DateTime.Now;


The datafield "Created Date" is a "date" field.

I use a console.writeline to see what date K2 is producing:

"... Created Date: 17/08/2006 20:57:04"

I then use a SQL event to write this value to a table.

The row within SQL is a "datetime" row.

K2Server tells me that:

"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated"

If I change the row in SQL to a string rather than datetime, it works.

If I change it to a smalldatetime, same error message.

If I change the data type in K2 to a string, same error message.

I don't understand the error. I am not trying to convert a char data to anything.

Has anyone seen this before?

Many thanks, Richard
SQL was throwing an exception.

In all my other processes, I hand coded the SQL events, using a specific account as my login.

In this process, as it was a straighforward insert, I used a built in event. Without thinking I used integrated authentication. The account (K2Manager) had it's default language configured as "English" rather than "British English".

Switching to an account with the correct default language solved the problem.

Probably an easy answer for the DBA's out there :D

Richard

Reply