当前位置: 代码迷 >> ASP.NET >> asp.net执行存储过程的有关问题!
  详细解决方案

asp.net执行存储过程的有关问题!

热度:3131   发布时间:2013-02-25 00:00:00.0
asp.net执行存储过程的问题!!
我建了一个存储过程:
create   procedure   pro
@ID   int,@voteItem   varchar(20)   output
as
set   nocount   on
declare   @voteNum   int
select   @voteItem=voteItem,@voteItem=voteItem
from   voteDetails
where   voteId=@ID
return   @voteNum

但是在用ASP.NET调用的时候出现错误(在SQLSERVER中能顺利执行)
System.ArgumentException:   不存在从对象类型   System.RuntimeType   到已知的托管提供程序本机类型的映射。


------解决方案--------------------------------------------------------
sqlcmd.Parameters.Add( "@voteNum ", SqlDbType.Int ).Direction = ParameterDirection.Output;
  相关解决方案