这段代码以RETURNEE NULL方式 [英] This code RETURNEE NULL way
本文介绍了这段代码以RETURNEE NULL方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此代码返回 null
其中sql存储过程返回3行。
我正试图使用以下存储过程
This code returns null
where sql stored procedure returns 3 rows.
I'm trying to to use below stored procedure
ALTER proc PrintInventoryStockTBL2
@Store_id int,
@InventoryDate date
as
select InventoryId,InventoryName,Product_id,Product_name,Store_id,Store_name,Quantity,
RealQuantity,Inability,Increase,InventoryDate from InventoryStockTBL
where Store_id=@Store_id and InventoryDate=@InventoryDate
try
{
Reports.Report2 reportcustomer = new Reports.Report2();
reportcustomer.SetDatabaseLogon("pc1", "12", "Server", "MnStores", false);
reportcustomer.SetParameterValue("@Store_id", this.txtStore_id.Text);
reportcustomer.SetParameterValue("@InventoryDate", this.dateTimePicker1.Text);
Reports.FormReport fmct = new Reports.FormReport();
fmct.crystalReportViewer1.ReportSource = reportcustomer;
fmct.ShowDialog();
}
catch { }
推荐答案
如果你没有收到任何错误,那么问题在于日期格式。
更改
If you are not getting any error ,then the problem is with the date format.
change
reportcustomer.SetParameterValue("@InventoryDate", this.dateTimePicker1.Text);
到
to
reportcustomer.SetParameterValue("@InventoryDate", this.dateTimePicker1.Value);
检查日期格式我认为日期格式不正确。
check the format of date I think date is not in correct format.
这篇关于这段代码以RETURNEE NULL方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文