I am trying to output an excel file and part of it puts the value of createddate from a table called outofstock the line is currently putting a 0
If I run this SQL it shows everything fine
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
The problem lies with this line in the aspx.cs file generating the output
createdon = DB.RSFieldDateTime(NotifyReader, "createdon");
I don't know what type (int, string etc) to place before. Within the SQL table the DataType is datetime but using this does not seem to work.
Any thoughts?
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");