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

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

博客园 - voiow

C#资源汇总 弹出窗口在屏幕中央 Server.CreateObject 的调用失败 - voiow - 博客园 SQL Server 2005表分区的具体实现方法 Server 2005之Integration Service简单实例 获取SQL Server数据库里表容量大小 自定义用户控件属性 - voiow - 博客园 使用asp下的adodb.stream 下载文件而不是打开 javascript以list方式封装xml - voiow - 博客园 Dynamic XML from SQL Server - voiow 如何用javascript拷贝当前页中被选中的文字? - voiow - 博客园 BizTalk使用发送端口组引起的问题解决方法 SQL Server日志清空方法 SQL SERVER 触发器实例 如何设计一个安全的WEBSERVICE 使用BizTalk Server常见问题处理 ASP.NET程序中常用的三十三种代码 浅谈反射与特性在接口系统中的应用(编码表转化) 使用window.createPopup();做的简单下拉菜单
将数据库存储的附件写到文件夹上面 - voiow - 博客园
voiow · 2009-12-21 · via 博客园 - voiow

SqlConnection conn = new SqlConnection("server=.;uid=sa;pwd=123;database=am89resource");
                    conn.Open();
                    SqlCommand cmd = new SqlCommand("", conn);
                    cmd.CommandText = "select * from picture where id='0331010009'";

                    SqlDataReader dr = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        byte[] bytes = (byte[])dr["img"];
                        FileStream fs = new FileStream(Server.MapPath("//img//1.gif"), FileMode.Create, FileAccess.Write);
                        fs.Write(bytes, 0, bytes.Length);
                        fs.Flush();
                        fs.Close();
                    }
                    conn.Close();