如何动态添加图片框中的图像和图像从数据库中获取 [英] How to dynamic add image in picture box and image get from database

查看:83
本文介绍了如何动态添加图片框中的图像和图像从数据库中获取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何动态添加图片框中的图像和图像从数据库中获取

请帮帮我

How to dynamic add image in picture box and image get from database
Please help me

推荐答案

基本上有好处的将图像存储在服务器中并在实体的字段中保存适当的路径,并且在从数据库获取图像控件之后检索只设置图像控件的路径。

例如: - 假设我们有一个图像id为'imgTest'。

Basically it is good to have storing the images in server and save the appropriate path in the field of the entity and while retrieving just set the path for the image control after getting it from database.
Ex :- Let say we have a image with id 'imgTest'.
string imageURL = "~/images/image.png";// URL from database varchar type column
imgTest.ImageUrl = imageURL;





OR



你也可以直接将图像保存在数据库中 varbinary 类型字段。

请参阅这个例子提到这里。 [ ^ ]



希望这对你有帮助。



OR

you can also directly save the image in database as varbinary type field.
Please see this example mentioned here.[^]

Hope this will definitely of help to you.


这篇关于如何动态添加图片框中的图像和图像从数据库中获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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