将图像从sql数据库检索到img标签 [英] Retrieve image from sql database to img tag
本文介绍了将图像从sql数据库检索到img标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将图像数据类型存储在sql server 2005中.
现在我想在asp.net中的标签上在网页上显示该图像
< pre lang =" > img1.Width = Convert.ToInt32(dt.Rows [0] [& quot; width& quot;]]);
img1.Height = Convert.ToInt32(dt.Rows [1] [& quot; height& quot]]);
img1.Src =&〜\\ viewimage.aspx?img =&" + dt.Rows [1] [& b_id&].ToString();
bn2.HRef = dt.Rows [1] [& quot; b_link& quot;].ToString(); < /pre >
viewimage.aspx页面已完成response.binarywrite(bytearray []);
告诉我如何绑定该图像
解决方案
存储和使用Microsoft .NET从SQL Server检索图像 [ ^ ]
hi
I have store images in sql server 2005 with image datatype.
Now i want show that image on webpage with tag in asp.net
<pre lang="midl">img1.Width = Convert.ToInt32(dt.Rows[0]["width"]);
img1.Height = Convert.ToInt32(dt.Rows[1]["height"]);
img1.Src = "~\\viewimage.aspx?img=" + dt.Rows[1]["b_id"].ToString();
bn2.HRef = dt.Rows[1]["b_link"].ToString();</pre>
viewimage.aspx page done response.binarywrite(bytearray[]);
tell me how to bind that image
解决方案
Storing and Retrieving Images from SQL Server using Microsoft .NET[^]
这篇关于将图像从sql数据库检索到img标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文