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

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - columbus.yan

windows server 2008 支持 .net framework 4.0 asp.net两层架构常用 - columbus.yan - 博客园 ASP.NET中备份恢复数据库 - columbus.yan - 博客园 SQL Server连接失败错误小结 一条指令搞定“关于内存不能READ“的问题 windows2003中安装.netframework1.1 解决数据库日志文件过满的又一方法 Windows XP 注册表修改大全 两步彻底解决数据库中的日志已满的情况 T-SQL使用技巧集锦5 T-SQL使用技巧集锦4 T-SQL使用技巧集锦3 T-SQL使用技巧集锦2 T-SQL使用技巧集锦1 在Asp.net中如何实现弹出提示对话框 C#中常用的经典文件操作方法 多条件查询存储过程 经典存储过程例子 sql大全
调用存储过程
columbus.yan · 2008-08-01 · via 博客园 - columbus.yan

不带参数的存储过程:
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
SqlCommand cmd = new SqlCommand(Procedure_name, conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
conn.Close();
DataSet ds = new DataSet();
da.Fill(ds);
return ds;

带参数的存储过程的调用:
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
SqlCommand cmd = new SqlCommand(Procedure_name, conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter pare1 = new SqlParameter("@id", SqlDbType.VarChar, 50);
SqlParameter pare2 = new SqlParameter("@name", SqlDbType.VarChar, 50);
cmd.Parameters.Add(pare1);
cmd.Parameters.Add(pare2);
cmd.Parameters["@id"].Value = parm1;
cmd.Parameters["@name"].Value = parm2;
SqlDataAdapter da = new SqlDataAdapter(cmd);
conn.Close();
DataSet ds = new DataSet();
da.Fill(ds);
return ds;