[Exception] String was not recognized as a valid DateTime

Last post 08-05-2008, 7:52 AM by ivan.fioravanti. 8 replies.
Sort Posts: Previous Next
  •  09-24-2007, 7:23 AM 18810

    [Exception] String was not recognized as a valid DateTime

    Hi,

    I am using K2 Blackpearl in a web application. I have added a SqlDatSource in a WebPage, and I have chosen the procedure LoadWorklistItem for the SELECT statement. However, when I click on "Test Query" at the end of the SqlDataSource configuration, I have the following exception:

    There was an error executing the query. Please check the syntax of the command and if present, the types and values of the parameters and ensure they are correct.

    Server Exception: String was not recognized as a valid DateTime. Couldn't store <24.09.2007 13:59:05> in StartDate Column. Expected type is DateTime.

    I have tried to deploy my process again, but it doesn't change anything.

    Does somebody have a solution ?

     Thanks,

    eraim

  •  09-25-2007, 5:01 AM 18827 in reply to 18810

    Re: [Exception] String was not recognized as a valid DateTime

    I have a similar unresolved issue with DateTime conversion. Basically, my SmartBox field is a DateTime and creating a new "Instance" is fine, but the "Load" method fails. It's almost as if the server is trying to convert the DateString into a DateTime but failing due to an “en-US” regional compatibility.

    Here is my setup:

    1. 1 Server with K2, SQL and all the WWW components installed

    2. SQL Server accounts all "British English"

    3. K2 Service Account regional settings set to “en-GB”

    Anybody seen this error as well and any workarounds available

    Cheers

     

  •  09-25-2007, 9:47 AM 18834 in reply to 18827

    Re: [Exception] String was not recognized as a valid DateTime

    I am experiencing the same issue. My configuration is the same as yours punkas, although I think its worth mentioning that our SQL Server instance is set to English (United States), which is something we can't seem to change. I would be interested to know whether its the same for you.

    Currently I know of no workaround, but there is a K2 consultant currently trying to assist us with the problem.
     

  •  09-25-2007, 12:44 PM 18835 in reply to 18810

    Re: [Exception] String was not recognized as a valid DateTime

    I had the same error when trying to join a process instance and a smartobject using a sqldatasource.  My workaround was to join the process instance to the process instance data to the smartobject where the process instance data field name was '<smartobject id>'.  Don't know if that actually helps anybody...
  •  10-01-2007, 5:50 PM 18973 in reply to 18835

    Re: [Exception] String was not recognized as a valid DateTime

    Ran into this issue again today.  Found out it has something to do with Date data fields where "Is Empty Date" is checked.  I just changed the data type to string and the error went away.
  •  10-02-2007, 7:05 AM 18982 in reply to 18973

    Re: [Exception] String was not recognized as a valid DateTime

    Hi,

    What's happening is that K2 will set the datafield to "0001/01/01" which is not valid in SQL. We have put through an enhancement request and it will be looked at with a future release. The workaround will be not to use blank date when you're getting this error.

    Regards

    Gert


    The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.
  •  12-18-2007, 5:52 AM 20551 in reply to 18982

    Re: [Exception] String was not recognized as a valid DateTime

    Gert, et. al.,

    The problem here is loading an existing date from the SmartBox into a SmartObject. The date (valid in the DB) cannot be converted. As some point it seems the date gets converted from the default DB en-US type to some localized type and I get this error when trying to Load the SmartObject:

    {"Server Exception: String was not recognized as a valid DateTime.Couldn't store <18/12/2007 11.34.57> in DateOfRequest Column.  Expected type is DateTime."}

    The conversion can only take place at the point where the K2 server connects and loads the data from the SmartBox. We've set the server's regional settings to en-US. What else should I check to ensure that the date gets selected in the correct format?

    Regards, Gabriel

  •  12-19-2007, 8:47 AM 20593 in reply to 20551

    Re: [Exception] String was not recognized as a valid DateTime

    We fixed this problem by logging in as the BP service account user and setting the regional settings for that user to en-US.
  •  08-05-2008, 7:52 AM 25358 in reply to 20593

    Re: [Exception] String was not recognized as a valid DateTime

    We have the same issue and setting BPService user regional setttigns to en-US did not solve the issue. Is regional options different from en_US supported by K2 ?

View as RSS news feed in XML