如何在asp.net中检索图像表单数据库并在图像控件中显示 [英] how to retrive image form database and show in image control in asp.net

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

问题描述

如何在asp.net中检索图像表单数据库并在图像控件中显示





i将此用于反向图像





 SqlConnection con =  new  SqlConnection(ConfigurationManager) .ConnectionStrings [  EatProject]。ToString()); 

con.Open();
string str = 选择Name,ImagePath ,链接,来自ImagesPath的状态,其中ID =' + DropDownList1.SelectedItem.Text + '< /跨度>;
cmd = new SqlCommand(str,con);

dr = cmd.ExecuteReader();
while (dr.Read())
{
TextBox4.Text = dr [ 名称]。ToString();
// Image1.ImageUrl = dr [Imagepath]。ToString();
TextBox5.Text = dr [ Link]。ToString();
TextBox6.Text = dr [ Status]。ToString();

}
con.Close();





但是图像控件中没有显示图像

解决方案

http://www.c-sharpcorner.com/UploadFile/satyapriyanayak/how-to-save-image-along-with-details-into-database-in- asp-ne / [ ^ ]



C#从数据库保存并加载图像 [ ^ ]



http://www.aspdotnet-suresh.com/2011/01/how-to-insert-images-into-database-and.html [ ^ ]


< blockquote>



使用C#在ASP.NET Image Control中预览图像 [ ^ ]





它会帮助你。


嗨亲爱的,

请参考我之前的帖子从下面链接



如何在图像控件中显示数据库中已准备就绪的图像 [ ^ ]


how to retrive image form database and show in image control in asp.net


i use this for retrive image


SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["EatProject"].ToString());

        con.Open();
        string str = "select Name,ImagePath,Link,Status from ImagesPath where ID ='" + DropDownList1.SelectedItem.Text + "'";
        cmd = new SqlCommand(str, con);

        dr = cmd.ExecuteReader();
        while (dr.Read())
        {
            TextBox4.Text = dr["Name"].ToString();
            //Image1.ImageUrl = dr["Imagepath"].ToString();
            TextBox5.Text = dr["Link"].ToString();
            TextBox6.Text = dr["Status"].ToString();
           
        }
        con.Close();



but image is not show in image control

解决方案

http://www.c-sharpcorner.com/UploadFile/satyapriyanayak/how-to-save-image-along-with-details-into-database-in-asp-ne/[^]

C# Save and Load Image from Database[^]

http://www.aspdotnet-suresh.com/2011/01/how-to-insert-images-into-database-and.html[^]


Hi ,

Previewing Image in ASP.NET Image Control using C#[^]


it ll help you.


Hi Dear,
Please refer my previous post from below link

How to show images in image control which are all ready present in the database[^]


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

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