What are the most suitable equivalent C# data types for the date datatypes in SQL Server? I'm specifically looking for
date
time
datetimeoffset
There is nothing equivalent to classes . Its a totally different paradigm. You can use structures in C. Have to code accordingly to make structures do the job.
Here are the equivalent CLR data types for date
, time
and datetimeoffset
SQL Server data types:
date - DateTime
, Nullable<DateTime>
time - TimeSpan
, Nullable<TimeSpan>
datetimeoffset - DateTimeOffset
, Nullable<DateTimeOffset>
Note that you can find a listing of all SQL Server data types and their CLR equivalents here, Mapping CLR Parameter Data
In C# you could use
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