Hi, the environment is the next:
It creates a new entity, the data are saved and retrieved by a query. It throws the following error: {"Version of entity with key 'MyEntity, (1)' differs from the expected one."} MyEntity myentity = new MyEntity();` // datetime = 01/01/0001 (DateTime default in DO) sessio.SaveChanges(); var t1 = sessio.Query.All<myentity>().First();` // {"Version of entity with key 'MyEntity, (1)' differs from the expected one."} Perhaps everything is correct, but is this the desired behavior? Thanks, PD Obviously, when DateTime is nullabe all is OK. |
The situation is that .NET DateTime type has wider range of values than MS SQL Server 2005 can provide, so 01/01/1753 is the minimal DateTime value it can store. Therefore, DataObjects.Net stores values less than 01/01/1753 value as 'minimal available value for the current database server'. In MS SQL Server 2008 datetime2 datatype was introduced, it can store values from 01/01/0001. Consider migration to 2008 version. |
Hello Petar,
Are you using SQL Server 2005?
Yes, SQL Server 2005 (9.00.4053.00 SP3)