如何用c#代码得到存储过程的返回值(希望能详细些) 20
存储过程如下:createprocck_je@idintasdeclare@sqjemoneydeclare@bxjemoneydeclare@flagbitselect...
存储过程如下:
create proc ck_je
@id int
as
declare @sqje money
declare @bxje money
declare @flag bit
select @sqje = jcJe from Jc where jcBh = (select sqBh from ccBx where [id] = @id)
select @bxje = bxJe from ccBx where [id] = @id
if(@sqje < @bxje)
begin
set @flag = 0
end
else
begin
set @flag = 1
end
return @flag
GO
------------------------------------------
假设连接字符串为strcon 展开
create proc ck_je
@id int
as
declare @sqje money
declare @bxje money
declare @flag bit
select @sqje = jcJe from Jc where jcBh = (select sqBh from ccBx where [id] = @id)
select @bxje = bxJe from ccBx where [id] = @id
if(@sqje < @bxje)
begin
set @flag = 0
end
else
begin
set @flag = 1
end
return @flag
GO
------------------------------------------
假设连接字符串为strcon 展开
1个回答
展开全部
create proc ck_je
@id int,
@sqje money output,
@bxje money output,
@flag bit output
as
/*
......
这些都不变
*/
>Procedure主要是把参数设置为output
>C#的代码主要是第二句,例如:
SqlParameter parm = new SqlParameter("@nickname", "百度");
parm.Direction=ParameterDirection.Output;
@id int,
@sqje money output,
@bxje money output,
@flag bit output
as
/*
......
这些都不变
*/
>Procedure主要是把参数设置为output
>C#的代码主要是第二句,例如:
SqlParameter parm = new SqlParameter("@nickname", "百度");
parm.Direction=ParameterDirection.Output;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询