首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >存储过程和ASP .NET

存储过程和ASP .NET
EN

Stack Overflow用户
提问于 2014-05-20 15:58:57
回答 2查看 45关注 0票数 0

我在sql server上创建了一个用于更新记录的存储过程,而当我插入所需的参数时,它可以正常工作.但是当涉及到ASP .NET时,当我在ASPX GridView上按update时运行应用程序时,它会给我一个消息“过程或函数custUPDATE有太多指定的参数”

这是我的程序代码

代码语言:javascript
运行
复制
   alter proc custUPDATE
( @odid int, 
  @customer_id int,
  @priceID int,
  @etAMOUNT int,
  @amntPaid decimal(18,2),
  @od_status varchar(20),
  @py_status varchar(20),
  @order_date smalldatetime
 -- @dummy varchar(30) =null
  )
as 
begin
set nocount on;
declare @amnt_paid decimal(18,2);
declare @rmn decimal(23,4);
declare @tt money;

select @amnt_paid=eggsOrders.amnt_paid from eggsOrders where od_ID=@odid;
select @rmn= orderVIEW.Remaining from orderVIEW where od_ID=@odid;
select @tt=orderVIEW.Total from orderVIEW where od_ID=@odid;
--select @amnt_paid= amnt_paid from inserted;



if(@amnt_paid=@tt)
begin
update [dbo].[eggsOrders] set customer_ID=@customer_id, price_ID=@priceID, ET_amount=@etAMOUNT, amnt_paid=@amntPaid, Od_status=@od_status, py_status='paid in full', order_date=@order_date where od_ID=@odid;

end

else if(@amnt_paid>0 and @amnt_paid!=@tt)
begin
update [dbo].[eggsOrders] set customer_ID=@customer_id, price_ID=@priceID, ET_amount=@etAMOUNT, amnt_paid=@amntPaid, Od_status=@od_status, py_status='In-Progress', order_date=@order_date where od_ID=@odid

end
else if(@amnt_paid=0 and @rmn =@tt)
begin
update [dbo].[eggsOrders] set customer_ID=@customer_id, price_ID=@priceID, ET_amount=@etAMOUNT, amnt_paid=@amntPaid, Od_status=@od_status, py_status='Payment Pending', order_date=@order_date where od_ID=@odid

end


end
go

我做错什么了?请帮帮忙

EN

Stack Overflow用户

发布于 2014-05-20 16:03:27

错误是非常清楚的:您向该方法传递的参数比它所期望的要多,这将导致错误。仔细检查在对SP的调用中要传递多少参数。

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23764748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档