存储过程的输出语句应显示在C#Windows应用程序中 [英] output statement of store procedure should display in C# windows application

查看:73
本文介绍了存储过程的输出语句应显示在C#Windows应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
下面我给出存储过程的执行语句

Hi all
Below I am giving the store procedure execute statement

DECLARE @ERROR varchar(100)
EXEC SP_New_OrderNo '890','123', @error output
PRINT @error


这里放了

请输入客户编号



现在我的问题是如何将此输出显示给我的C#Windows应用程序

感谢all


here the out put

PLEASE ENTER CUSTOMER NO.



Now My question is how to show this output to my C# windows application

Thanks to all

推荐答案

我看到@error是输出参数,您可以在c#代码中读回该值.查看MSDN 文档 [ http://msdn.microsoft.com/en-us/library/a0hee08w (v = vs.80).aspx [ http://www.dotnetcurry.com/ShowArticle.aspx?ID=344 [ ^ ]
I see that @error is a output parameter, you can read the value back in your c# code. Look at MSDN documentation [^]to read the value from Out Parameter.

Alternatively, You can also use InfoMessage event to read the PRINT statements.

http://msdn.microsoft.com/en-us/library/a0hee08w(v=vs.80).aspx[^]

http://www.dotnetcurry.com/ShowArticle.aspx?ID=344[^]




您可以将输出参数用作存储过程的返回值.

供您参考, MSDN示例代码 [
Hi

You can use output parameter for the stored procedure return value.

For your reference, MSDN sample code[^]

Thanks
-Amit Gajjar


这篇关于存储过程的输出语句应显示在C#Windows应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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