如何在Image控件中显示浏览的图像以及要存储在DataBase中的图像。 [英] how to display browsed image in Image control and that image to be stored in DataBase.?

查看:37
本文介绍了如何在Image控件中显示浏览的图像以及要存储在DataBase中的图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 con.Open(); 
cmd = new SqlCommand( insert into picture(pic) + values(@pic),con);
cmd.CommandType = CommandType.Text;
SqlParameter pic1 = new SqlParameter( @ pic,SqlDbType.Image,imageSize.Length);
pic1.Value = imageSize;
cmd.Parameters.Add(pic1);
con.close();





从上面的代码中,它插入到数据库中,但不在Image Control中显示。 br />


如何在图像控件中显示图像?

解决方案

http://www.dotnetcurry.com/ShowArticle.aspx?ID=129 [ ^ ]


给定的文章可能会对您有所帮助。 />
FileUpload控件并在数据库中保存图像 [ ^ ]

插入并保存图像数据库 [ ^ ]


通过以下CP链接



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

con.Open();
cmd = new SqlCommand("insert into picture(pic)" + "values(@pic)", con);
cmd.CommandType = CommandType.Text;
SqlParameter pic1 = new SqlParameter("@pic", SqlDbType.Image, imageSize.Length);
pic1.Value = imageSize;
cmd.Parameters.Add(pic1);
con.close();



From the above code it is inserting into database but not displaying in Image Control.

How do I display the image in an Image Control?

解决方案

http://www.dotnetcurry.com/ShowArticle.aspx?ID=129[^]


The given article might help you.
FileUpload Control and Save image in Database[^]
Insert and Save Image in Database[^]


go through the below CP link

C# Save and Load Image from Database[^]


这篇关于如何在Image控件中显示浏览的图像以及要存储在DataBase中的图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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