什么是SQL Server的日期,时间和DATETIMEOFFSET相当于C#中的数据类型? [英] What are equivalent C# data types for SQL Server's date, time and datetimeoffset?

查看:574
本文介绍了什么是SQL Server的日期,时间和DATETIMEOFFSET相当于C#中的数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是SQL Server中的数据类型日期最合适的等价的C#的数据类型?我专门找

What are the most suitable equivalent C# data types for the date datatypes in SQL Server? I'm specifically looking for


  • 日期

  • 时间

  • DATETIMEOFFSET

  • date
  • time
  • datetimeoffset

推荐答案

下面是等效的CLR数据类型日期时间 DATETIMEOFFSET SQL Server数据类型:

Here are the equivalent CLR data types for date, time and datetimeoffset SQL Server data types:

- 的DateTime 可空< DateTime的> 结果
时间 - 时间跨度可空<时间跨度> 结果
DATETIMEOFFSET - 的DateTimeOffset 可空<的DateTimeOffset>

date - DateTime, Nullable<DateTime>
time - TimeSpan, Nullable<TimeSpan>
datetimeoffset - DateTimeOffset, Nullable<DateTimeOffset>

请注意你可以找到所有SQL Server数据类型和CLR当量的列表在这里,映射CLR参数数据

Note that you can find a listing of all SQL Server data types and their CLR equivalents here, Mapping CLR Parameter Data

这篇关于什么是SQL Server的日期,时间和DATETIMEOFFSET相当于C#中的数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆