如何在图像控件上显示图像。从数据库中获取路径 [英] how to display image on image control.getting the path from the database
本文介绍了如何在图像控件上显示图像。从数据库中获取路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在图像按钮控件上显示图像。从数据库中获取路径
这里我成功地将照片保存在数据库中。我面临的是在图像按钮控件上显示该照片。
任何人都可以快速帮助..
how to display image on image button control.getting the path from the database
Here i am saving the photo in database successfully.what i am facing is to display that photo on the image button control.
can any one help fast..
推荐答案
string SelStr = "select * from Users";
SqlDataAdapter da = new SqlDataAdapter(SelStr, con);
DataTable dt = new DataTable();
da.Fill(dt);
foreach(DataRow dr in dt.Rows)
{
ImageCtrl.ImageUrl = dr["ImagePath"].ToString();
}
尝试它是否有效......只是我的盲目假设..
Try if it works.. just my blind assumption..
参考此链接 -
http:// www .dotnetcode.in / 2011/06 / how-to-store-imageurl-in-database-and.html [ ^ ]
Refer this Link-
http://www.dotnetcode.in/2011/06/how-to-store-imageurl-in-database-and.html[^]
imgDisplayPhoto.ImageUrl = ViewState [ Photo_Path]。ToString();
直接我们可以给出保存在数据库中的照片路径。
感谢每一位为我付出宝贵时间的人.......
imgDisplayPhoto.ImageUrl = ViewState["Photo_Path"].ToString();
directly we can give the path of the photo which is saving in the database.
thanks for every one who spended their valuable time for me....
这篇关于如何在图像控件上显示图像。从数据库中获取路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文