How do you use C# to insert into an SQL table the very end of a day?
Example:
2012-03-01 23:59:59
This field in my database (SQL SERVER) is SmallDateTime. When I edit this field in SQL Management Studio and up the seconds to 50 this changes to 00:00:00.
If you want to reference the last second of a day, you’ll need to change your column from SmallDateTime to DateTime since SmallDateTime does not support seconds.
SmallDateTime
From MSDN:
smalldatetime
Date and time data from January 1, 1900, through June 6, 2079, with accuracy to the minute. smalldatetime values with 29.998 seconds or lower are rounded down to the nearest minute; values with 29.999 seconds or higher are rounded up to the nearest minute.