2014-11-14 27 views
0
alter procedure [dbo].[XXX] 
(
    @vendorworksationID uniqueidentifier , 
    @sdate date, 
    @edate date, 
    @total int out 
) 
begin 
    select @total = COUNT(*)  
    from AdvertisedCampaignHistory a 
    where 
     CAST(a.CreationDate AS DATE) BETWEEN CAST(@sdate as DATE) AND CAST(@edate as DATE) 
     and a.CampaignID in (select cc.BCampaignID 
          from BeaconCampaign cc, VendorWorkStation vw 
          where cc.VendorWorkStationID = vw.VendorWorkStationID 
           and VendorID = @vendorworksationID) 
    return @total 
end 

上面的代码表明,从SQL Server返回一个整数值的存储过程如何采取从SQL存储过程的输入到return语句

ObjectParameter Output = new ObjectParameter("total", typeof(Int32)); 
var resBC = this.Context.getTotalSentBeaconCampaign(VendorWorkstationID, sdate,edate,Output).FirstOrDefault(); 

上面的代码显示我如何传递参数和在C#侧

检索值在运行我收到以下错误

中的DAT代码由商店数据提供商返回的阅读器没有足够的 列查询请求。

什么可能是这个错误的可能原因?

回答