3
In my application, with Entity Framework, I make a query in a Round entity:
var lista = contexto.Rodada.Where(condições);
Then I’ll go over that list with a foreach.
During iteration "updates" and "Inserts" occur from multiple entities and one of them is responsible for the following error:
The Conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated.
Searching, I saw that the reason for this error is that the default (or minimum) value for datetime in c# is outside the range of values accepted in Sql Server:
I’m trying to pinpoint where this happens, but there’s a lot of datetimes across multiple entities, and the stack trace didn’t help me at all. Is there any way to identify the entity that launched the error?
Put all the code in your question, please, to identify the problem? Which version of the Sqlserver database also
– novic