在一个函数方法中调用两个存储过程 [英] calling two stored procedure in one function method

查看:205
本文介绍了在一个函数方法中调用两个存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否提供示例代码,说明如何使用带有事务和提交的SqlCommand在一个函数方法中调用两个存储过程?

感谢

can you provide sample code on how calling two stored procedure in one function method using SqlCommand with Transaction and Commit?

thanks

推荐答案

首先,学习如何使用存储过程以及如何执行存储过程:

http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/ms131094%28v = sql.100%29.aspx [ ^ ].

此CodeProject文章也可能有用:在ADO.NET中调用存储过程 [^ ].

完成此操作后,编写一些执行存储过程的方法,然后编写另一个方法.您将获得一个执行两个的方法. :-)

—SA
First, learn how to use stored procedures and how to execute one:

http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx[^],
http://msdn.microsoft.com/en-us/library/ms131094%28v=sql.100%29.aspx[^].

This CodeProject article can also be useful: Calling Stored procedures in ADO.NET[^].

After this is accomplished, write some method which executes of stored procedure, then another one. You will get a method which executes two. :-)

—SA


这篇关于在一个函数方法中调用两个存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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