This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have an entity with two datetime fields/columns; CreatedDate and ModifiedDate. In my code to update an entity, I get the following error: "The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value."
I have tried both UpdateModel() and TryUpdateModel(). The columns in the database are set as DateTime, as are they in the LS Designer. I am using LS version 4.0.1685.21847 Thanks, James |
|
|
Hi James, What is the value of CreatedDate? Is it DateTime.MinValue? And are you using the SqlServer2008 provider? On SQL Server 2008 if you have a date time that falls outside of the range of a normal datetime (e.g. DateTime.MinValue) then we use a DateTime2 data type to send this to SQL Server. So the actual problem you are likely to be running into is that you are dealing with a date that is not covered by a datetime value in SQL Server. The range for a datetime is Jan 1, 1753 - Dec 31 9999 so check that the value you are using falls inside that range.
|
|
|
I found the issue. CreatedDate was not being passed back to the method. sigh.... Thanks James |
|