让图片以2进制的形式保存在数据库中

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->int len = fu.PostedFile.ContentLength; // 图片大小 byte[] pic = new byte[len]; // 创建一个字节数组,大小为图片的大小,数据库中就存储这个东西 fu.PostedFile.InputStream.Read(pic, 0, len); // 把上传控件中的文件用二进制读取存到pic字节数组中 // 插入图片到数据库中 SqlC 阅读全文
posted @ 2013-03-19 12:12 平小 阅读(288) 评论(0) 推荐(0)

网站积累

摘要: 数据库连接:<appSettings/><connectionStrings> <add name="conn" connectionString="Data Source=FUCK-PC\SQLEXPRESS;Initial Catalog=jxcSystem;Integrated Security=True"/> </connectionStrings><system.web> <!--出错时跳转页--> <customErrors mode="On" 阅读全文
posted @ 2013-03-19 11:58 平小 阅读(131) 评论(0) 推荐(0)