I have a datetime column in the db and when I test setting it
DateTime dateTime = DateTime.Now;
state.LastUpdated = dateTime;
Assert.AreEqual(dateTime , state.LastUpdated);
I get the following error
Assert.AreEqual failed. Expected:<3/2/2011 9:52:32 AM>. Actual:<3/2/2011 9:52:00 AM>.
What's the granularity of SQL datetime and is it possible to tune it for more granularity?
Use datetime2, which has up to 100 nanoseconds precision. msdn.microsoft.com/en-us/library/bb677335.aspx
Noted by @Remus in a comment, posting it as an answer for posterity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With