如何在asp.net中显示存储过程的打印语句 [英] how to display Print statement of Stored Procedure in asp.net

查看:91
本文介绍了如何在asp.net中显示存储过程的打印语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在sql中有一个存储过程.


Hi,

I have a stored Procedure in sql.


ALTER proc [dbo].XYZ
@EM varchar(100),@FY varchar(100),@AL numeric(18,2),
@EL numeric(18,2),@BL numeric(18,2),@OE varchar(100)
as
declare @count int
select @count=count(*) from Table1 where OE=@OE and
FY=@FY
if(@count>0)
begin
Print 'Record Already Exists'
end
else
begin
insert into Table1 (OE,FY,AL,EL,@BL,ActionDate)
values(@OE,@FY,@AL,@EL,BL,getdate())
Print 'Record Saved Successfully'
end




我想在asp.net的标签中显示打印对帐单".

请帮助




I want to display Print Statement in a Label in asp.net.

Please Help

推荐答案

打印仅用于在sql服务器消息中显示结果.无法获取.如果希望消息意味着获取用于设置结果的参数.
Print is used for only show results in sql server messages.not get it.If you want message means get parameters to set that.


您需要从存储过程中返回文本数据.
在这里查看: MSDN:从存储过程返回数据 [
You need to return the text data from Stored Procedure.
Look here: MSDN: Return Data from a Stored Procedure[^]


您也可以使用相同的输出"参数.
You also can use "output" parameter for the same.


这篇关于如何在asp.net中显示存储过程的打印语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆