从数据库中检索图像在图像控件中显示 [英] Retrieve images from database & Show in Image Control

查看:81
本文介绍了从数据库中检索图像在图像控件中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将图像存储在表中,但是我没有存储图像路径,我只存储了图像数据,所以告诉我如何从数据库中检索这些图像并在图像"控件中显示吗?我正在使用SqlServer 2005&asp.net 3.5,请告诉我该怎么做?如果可能的话,也向我发送代码.我的电子邮件ID为[已删除电子邮件地址]

I have stored images in table but I haven''t stored image path I have only stored image data so tell me how to retrieve those images from database & show in Image control? I am using SqlServer 2005 & asp.net 3.5 please tell me how to do this? if possible then send me code also.My email id is [e-mail address removed]
thanks in advance.

推荐答案

^ ] [ ^ ] 大量 [ ^ ] of [ ^ ] ^ ].

Google是您的朋友! ;)
There[^] are[^] plenty[^] of[^] examples[^].

Google is your friend! ;)


没什么..

为其他数据做任何事情.使用图像数据类型字段,然后使用字节数组将文件传递给它.

同样,在您检索时,

在ByteArray中获取Image数据并将其转换为文件.

:)
No big deal..

Do whatever you do for other data. Use an Image Data type field and pass the file to it using Byte Array.

Similarly while you retrieve,

get the Image data in ByteArray and convert it to file.

:)


每当在数据库中存储图像详细信息时,最简单的方法就是将图像路径也存储到数据库表中...


因此很容易将imageurl分配给图像控件...
whenever you store the image details in the database then the easiest way is to store the image path also to the database table...


so its easy to assign imageurl to an image control...


这篇关于从数据库中检索图像在图像控件中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆