c++ - 在 C++ 中读取、操作和写入 SQLServer DateTimeOffset 字段

标签 c++ sql-server datetime

SQLServer 2008 引入了一个非常受欢迎的 DateTimeOffset field type .

.Net 3.5 以上的版本引入了相应的 DateTimeOffset structure .

我想知道如何在 C++ 中操作同一个字段。 documentation for CDBVariant不讨论 DateTimeOffset。

如何在 C++ 中操作 DateTimeOffsets?

最佳答案

我认为this MSDN 页面可能对您有用。它包括一个关于如何使用新的日期/时间结构的 C++ 示例。从页面描述:

This sample shows how to initialize the date/time data structures that were added in SQL Server 2008. It then prepares the input values, binds parameters, and executes the query. For more information about using these types, see Date/Time Improvements (ODBC).

关于c++ - 在 C++ 中读取、操作和写入 SQLServer DateTimeOffset 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17280389/

相关文章:

c++ - 为什么 make_optional 不适用于文件流?

c++ - 防止在头文件之外创建子类

SQL Server 函数返回问号而不是实际结果

sql - SqlConnection 是否并行处理查询?

php - 使用 php 验证 RFC3339 日期时间

c# datetime 值基于当前日期传递

c++ - C2664 无法从 'initializer list' 转换参数

c++ - 如何在 C++ 中同时拥有 32 位和 64 位 float

sql - PIVOT 的 FOR 部分中的表达式

datetime - 如何将 int 90 分钟转换为 DateTime 1 :30?