What is the equivalent of SQL Server 2008's time(7)
datatype in .NET? I want to store hours and minutes alone in that column, for this which datatype should I use in SQL Server!
MSDN gives a mapping between SQL data types and CLR data types - and it suggests TimeSpan
and Nullable<TimeSpan>
(for nullable columns) too. Note that how you access the data will determine how you actually get the value out though. DbDataReader
doesn't have a GetTimeSpan
method for example - but SqlDataReader
does have such a method. I'd expect LINQ to SQL or Entity Framework to perform the mapping automatically.
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