以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 SVG/GML/VRML/X3D/XAML 』 (http://bbs.xml.org.cn/list.asp?boardid=21) ---- 怎样把存在数据库的图片数据<binary>转化成ImageBox可以有的 (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=18303) |
-- 作者:feiniao_21 -- 发布时间:5/14/2005 5:07:00 PM -- 怎样把存在数据库的图片数据<binary>转化成ImageBox可以有的 SqlCommand cmd; cmd = new SqlCommand("INSERT INTO photodata (ID, data) " + "VALUES (@CustomerID, @CompanyName)", cnn); cmd.Parameters.Add("@CustomerID", SqlDbType.Int, 5); byte[] b=(byte[])dr["data"]; 兄弟帮忙啊,小弟感激不尽!!
|
-- 作者:edison1024 -- 发布时间:5/16/2005 9:23:00 AM -- 这是MSDN的例子。以后要养成查帮助的习惯哦。 SqlConnection pubsConn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=pubs;"); FileStream fs; // Writes the BLOB to a file (*.bmp). int bufferSize = 100; // Size of the BLOB buffer. string pub_id = ""; // The publisher id to use in the file name. // Open the connection and read data into the DataReader. while (myReader.Read()) // Create a file to hold the output. // Reset the starting byte for the new BLOB. // Read the bytes into outbyte[] and retain the number of bytes returned. // Continue reading and writing while there are bytes beyond the size of the buffer. // Reposition the start index to the end of the last buffer and fill the buffer. // Write the remaining buffer. // Close the output file. // Close the reader and the connection. |
-- 作者:feiniao_21 -- 发布时间:5/17/2005 3:57:00 PM -- 很感谢楼上的回答! 我想从数据库里查到这些数据,让它直接在控件PictureBoxl里显示 但,我不想保存那些从数据库中的<binary>数据!。 public void init(string url) } |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
62.500ms |