【发布时间】:2011-06-06 14:25:12
【问题描述】:
我一直在尝试让我的 C# 程序使用 .NET 业务连接器将记录直接插入到 Dynamics AX 2009 数据库中。
到目前为止,我可以轻松插入一个字符串、int、int64、枚举(否),但每次我尝试插入 dateTime 字段(在 AX 中该字段定义为 UtcDateTime)时都会失败,并出现错误:
提供的方法参数无效。
我确定这是我缺少的一些简单的东西。
代码片段:
using (axRecord = ax.CreateAxaptaRecord("TempTable"))
{
// Fails on this line with error: The supplied method arguments are not valid.
axRecord.set_Field("DateField", DateTime.Now);
axRecord.Insert();
}
我尝试过作为字符串传递并使用dateTime.parseExact等,但它似乎仍然不起作用。
【问题讨论】:
标签: c# dynamics-ax-2009 business-connector