【发布时间】:2023-03-15 04:38:01
【问题描述】:
我正在尝试输出一个 excel 文件,其中一部分将 createddate 的值从名为 outofstock 的表中放入该行当前放入 0
如果我运行这个 SQL,它会显示一切正常
select wo.email, wo.productid, wo.variantid, p.NAME pname,
p.SKU psku, wo.createdon, pc.CategoryID, c.Name
from woeosemails wo
join Product p with (nolock) on p.ProductID = wo.productid
left join ProductCategory as pc (nolock) on p.ProductID=pc.ProductID
left join Category as c (nolock) on pc.CategoryID=c.CategoryID
order by wo.createdon, wo.email, wo.productid
问题在于生成输出的 aspx.cs 文件中的这一行
createdon = DB.RSFieldDateTime(NotifyReader, "createdon");
我不知道之前要放置什么类型(int、string 等)。在 SQL 表中,DataType 是 datetime,但使用它似乎不起作用。
有什么想法吗?
string email = DB.RSField(NotifyReader, "email");
int productid = DB.RSFieldInt(NotifyReader, "productid");
int variantid = DB.RSFieldInt(NotifyReader, "variantid");
string createdon = DB.RSFieldDateTime(NotifyReader, "createdon");
string psku = DB.RSField(NotifyReader, "psku");
string pname = DB.RSField(NotifyReader, "pname");
string cname = DB.RSField(NotifyReader, "cname");
【问题讨论】:
-
使用
DateTime会发生什么? -
RSFieldDateTime 是你的方法,还是那是什么?