DataSet.xsd 无法列出存储过程中的列
我有一个使用 ASP.Net MVC 3 的项目,现在我正在为我的项目创建一个报告。我的项目中有几个报告,它们都使用存储过程。为了在 MVC 3 中创建报告,我首先创建一个新数据集。我的一份报告有问题。我有一个像这样的过程(名为 SP_Rpt
):
CREATE TABLE #temp_batch (batch_id VARCHAR(20))
EXEC SP_StrListToTable @batchId, ',', #temp_batch
select Batch_Id, Batch_Date
from Batch
where Batch_Id in (select * from #temp_batch)
and isnull(Payment_Decline_Date,'') = '' and Payment_Amount > 0
and Batch_Open = 0 and Invoice_Paid_Amt > 0
当我尝试使用 SP_Rpt
添加新的表适配器时,出现此错误:
配置 TableAdapter 时向导检测到以下问题:“SP_Rpt”
详细信息:
生成 SELECT 语句无效对象名称“#temp_batch”
要将这些组件添加到您的数据集,请单击“完成”。
我单击“完成”,但我的表适配器中没有列。但我可以预览数据。当我创建报告并选择该数据集时,我没有任何列(我无法设计新报告)。我的程序有问题吗(我不这么认为,因为我可以预览数据)?如何使用该存储过程列出数据集中的列?
谢谢
I have a project using ASP.Net MVC 3 and now I'm creating a report for my project. I have several reports in my project and all of them are using stored procedures. For creating a report in MVC 3, first I create a new dataset. I have trouble with one of my reports. I have a procedure like this (named SP_Rpt
) :
CREATE TABLE #temp_batch (batch_id VARCHAR(20))
EXEC SP_StrListToTable @batchId, ',', #temp_batch
select Batch_Id, Batch_Date
from Batch
where Batch_Id in (select * from #temp_batch)
and isnull(Payment_Decline_Date,'') = '' and Payment_Amount > 0
and Batch_Open = 0 and Invoice_Paid_Amt > 0
when I try to add new table adapter using SP_Rpt
I get this error:
The wizard detected the following problems when configuring the TableAdapter: "SP_Rpt"
Details:
Generate SELECT statement invalid object name '#temp_batch'
To add These components to your dataset, click Finish.
I click finish and there's no column in my table adapter. But I can to preview data. And when I create Report and choose that dataset, I don't have any column (I can't design new report). Is there something wrong with my procedure (I don't think so, because I can preview data) ? How to list column in my data set using that stored procedure ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下内容放在存储过程的开头:
在 Visual Studio 中检索使用临时表的存储过程的字段架构
Put the following at the beginning of the stored procedure:
Retrieve fields schema in Visual Studio of stored procedure which uses temp tables