如何在C#.net中检索特定的存储过程 [英] How to retrieve particular stored procedure in C#.net

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

问题描述

大家好,

我需要通过输入sp名称
来检索特定的存储过程 例如:-来自SQL Server的sp_helptext``spname'',需要另存为文本文件.

使用带有C#.net的console/windows/asp.net应用程序.

任何机构都可以在此要求上提供帮助.

预先感谢,
Bala.

Hi All,

I need to retrieve particular stored procedure by inputing the sp name
Ex :- sp_helptext ''spname'' from sql server and need to save as text file.

using console / windows / asp.net application with C#.net.

can any body help on this requirement.

Thanks in advance,
Bala.

推荐答案

过程的哪一部分对您来说是一个问题.我们当然不会为您编写所有代码.那是你的工作.我们可以帮助您解决写作时出现的问题.
您的初始步骤将是:
1)确保您有问题数据库的有效连接字符串,并确保所使用的凭据具有运行sp_helptext过程的特权.
2)创建您的C#项目.
3)根据您决定使用的进程,将连接字符串添加到web.config或app.config中.
4)编写代码以执行该过程,并将结果写入文件.
What part of the process is a problem for you. We''re certainly not going to write all the code for you. That is your job. We can help you with issues that arise while writing.
Your initial steps would be:
1) Make sure you have a working connection string to the database in question and ensure that the credentials used have privileges to run the sp_helptext procedure.
2) Create your C# project.
3) Add your connection string to the web.config or app.config depending on which process you decide to use.
4) Write your code to execute the procedure and write the results to a file.


这篇关于如何在C#.net中检索特定的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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