How does one use the SQL time
datatype introduced in SQL Server 2008 in C#.NET?
I've been trying to get it to work but no success.
The seconds and fractional seconds are set to 0. The following code shows the results of converting a time(4) value to a smalldatetime value. If the conversion is to datetimeoffset(n), the date is set to '1900-01-01', and the time is copied. The time zone offset is set to +00:00.
The DATETIME data type stores an instant in time expressed as a calendar date and time of day. You select how precisely a DATETIME value is stored; its precision can range from a year to a fraction of a second.
Here is an MSDN article that reviews all the new Date and Time datatypes introduced in SQL Server 2008 with respect to ADO.NET. As the document says: For System.Data.DbType.Time
you would use the .NET Framework type System.TimeSpan
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