What's the difference between DbType.Time
and DbType.DateTime
?
#103914
-
I'm trying to mark a property with a custom attribute which takes a [SqlColumn(nameof(Sample), DbType.Time)]
public TimeSpan? Sample { get; set; } According to the documentation for
I can't follow the recommended path of using
What's the difference between |
Beta Was this translation helpful? Give feedback.
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.
DbType
is a maps to ODBC type: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