What's the difference between DbType.Time
and DbType.DateTime
?
#103914
Replies: 2 comments
-
@tacosontitan However, the type Not even the corefx repo shows me how this was caused. @SamMonoRT @ajcvickers @roji As you're the area owners of |
Beta Was this translation helpful? Give feedback.
-
runtime/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs Lines 864 to 866 in 97f5045 runtime/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs Lines 770 to 772 in 97f5045 The official MSSQL documentation mentions mapping for According to https://learn.microsoft.com/en-us/sql/relational-databases/native-client/features/date-and-time-improvements?view=sql-server-ver15#use-time-as-a-distinct-data-type , Anyway, this involves a lot of legacies with ODBC and is probably beyond .NET. I'd suggest to not trust the doc and test for what is actually mapped to the DB. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to mark a property with a custom attribute which takes a
DbType
to specify what the database type is for the property, and in this case my property is aTimeSpan?
:According to the documentation for
DbType
, this is the wrong member to mark with:I can't follow the recommended path of using
SqlDbType.Time
because it's not interchangeable withDbType
. Furthermore,DbType
defines a member namedDateTime
which causes further confusion:What's the difference between
DbType.Time
andDbType.DateTime
?Beta Was this translation helpful? Give feedback.
All reactions