惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - CoolBug

准备做培训,欢迎大家来讨论 上海蜗牛招聘.NET程序员 博客园2007-10-27上海聚会 上海招聘.NET(C#)程序员 激情哪里去了II 上海蜗牛信息科技招聘.NET开发工程师 招人 SQL Server不存在或访问被拒绝 Windows里的一个bug 安装acdsee 3.1后出错 .net软件开发工程师简历 coolbug个人简历 Visual Studio 2005的应用问题,谁有解决方法 轻松配置自己的网络IP,网关,及DNS VS出错问题集锦 <<妮子>> 一些感动的日子 周末游山 相亲,再次相亲 周末--------粉红色的回忆 今夜微风轻送,把我的心吹动...
将数据库的存储过程及其参数导出来的方法
CoolBug · 2006-04-07 · via 博客园 - CoolBug

久学培训网--国内最大的培训平台!
免费发布课程,需求,查找课程,讲师,机构
培训课程:电脑,英语,日语,企业管理,职业,法语,软件,驾驶,口语,物流,厨师,网络,网络,美容,才艺,会计,股票,舞蹈
...

这两天需要将CCS里所有的存储过程导成表格的形式,拿出来分析。于是...
导出结果:

 


然后直接粘贴到Word文档里,就成了设计文档了,方便否?

web.config配置:

<add key="DSN" value="server = (local);database = ccs;uid=sa;pwd=***" />

代码,页面有一Label,ID为:lblStoreProcedure:

 1private void BindStoreProcedure()
 2            {
 3                string ConnString = System.Configuration.ConfigurationSettings.AppSettings["DSN"];
 4                SqlConnection conn = new SqlConnection(ConnString);
 5                DataSet ds = new  DataSet();
 6                SqlDataAdapter da = new SqlDataAdapter("SELECT   name,id FROM dbo.sysobjects WHERE (xtype = 'p') AND (LEFT(name, 2) <> 'dt')",conn);
 7                da.Fill(ds);
 8                
 9                for(int i =0 ;i<ds.Tables[0].Rows.Count;i++)
10                {
11                    this.lblStoreProcedure.Text +="<b>"+Convert.ToInt32(i+1).ToString()+""+ ds.Tables[0].Rows[i]["name"].ToString() + "<b><br>";
12                    this.lblStoreProcedure.Text +="<br><b>作者:</b>";
13                    this.lblStoreProcedure.Text +="<br><b>日期:</b>";
14                    this.lblStoreProcedure.Text +="<br><b>说明:</b>";
15                    this.lblStoreProcedure.Text +="<br><b>参数:</b>";
16                    this.lblStoreProcedure.Text += "<table border = '1' bordercolor='#4D4D4D' width = '600' cellpadding='0' cellspacing='0' >";
17                    this.lblStoreProcedure.Text +="<tr><td>参数</td><td>说明</td></tr>";
18                    DataSet ds2 =  GetDataSet(conn,ds.Tables[0].Rows[i]["id"].ToString());
19                    foreach(DataRow r in ds2.Tables[0].Rows)
20                    {
21                        this.lblStoreProcedure.Text += "<tr>";
22                        this.lblStoreProcedure.Text += "<td width='10%'>"+r["name"].ToString()+"</td>";
23                        this.lblStoreProcedure.Text += "<td>&nbsp</td>";
24                        this.lblStoreProcedure.Text += "</tr>";
25                    }

26                    this.lblStoreProcedure.Text += "</table><br>";
27
28                }

29            }

30        private DataSet GetDataSet(SqlConnection conn,string id)
31        {
32            
33            DataSet ds = new  DataSet();
34            SqlDataAdapter da = new SqlDataAdapter("SELECT  name from syscolumns where  id = "+id,conn); 
35            da.Fill(ds);
36            return ds;
37        }

不知道有没有人可以把 @参数后的注释能够取出来?我目前还没有发现。

阿里云优惠券领取地址:https://partner.aliyun.com/shop/35783975 ,需要更多优惠请联系QQ和微信:891115,热线:400-968-4968