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
|
I have a complicated piece of code that is ultimately saving about 15 different objects. The commit is failing with a SQL error "The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value". The problem is I can't determine which object was causing the error. There are no hints in the Exception StackTrace as to which object (or even which Object Type) is causing the error. Is there any way to print out all SQL statements that are being issued to the database to the Console? Or is there some other way to determine what object is causing the error when UnitOfWork.Save() fails? Thanks |
|
|
You can use the logging capability detailed here http://www.mindscapehq.com/documentation/lightspeed/Testing-and-Debugging/Logging to see the SQL output. HTH James |
|
|
Further to this, are you using the SQL Server 2008 provider (or higher)? If so check that you don't have a DateTime.MinValue being assigned somewhere where the underlying database column is a datetime. With the 2008 provider we automatically assume values that are outside of the valid range of a normal datetime should be handled using datetime2.
|
|