将图像从数据网格保存到Sql DataBase [英] Save Image from Data Grid to Sql DataBase

查看:78
本文介绍了将图像从数据网格保存到Sql DataBase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

我正在开发一个学校项目,其中所有学生信息都在Datagridview中输入,我还在datagridview中添加了学生图像

现在我要保存从datagrid视图到SqlDatabase的图像





先谢谢

Hi Friends
I am developing a school project in which all the student Information is Typed in Datagridview and i also added student image in datagridview
Now i want to save the image from datagrid view to SqlDatabase


Thanks in Advance

推荐答案

这是获得单元格值的方法: http:// msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.value.aspx [ ^ ]。



如果你不是确保if的类型是正确的类型( System.Windows.Forms.DataGridViewImageCell 还是能够在值中存储图像的自定义类型,您可以检查该值是否具有您期望的类型:

http://msdn.microsoft.com/en- us / library / system.windows.forms.datagridviewcell.valuetype.aspx [ ^ ]。



关于在数据库中存储和检索图像老实说,一遍又一遍地回答这个问题并不好。您可以从现有答案中找到所有答案: http://www.codeproject.com/search.aspx?doctypeid=5&q=database+%28image+OR+images+OR+bitmap+OR+bitmaps%29 [ ^ ]。



祝你好运,

-SA
This is how you get a value of the cell: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.value.aspx[^].

If you are not sure that the cell of if the proper type (System.Windows.Forms.DataGridViewImageCell or a custom type capable of storing an image in its Value, you can check up that the value has the type you expect:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.valuetype.aspx[^].

As to the storing and retrieving images in/from a database, honestly, it''s not good to answer this question over and over. You can find it all from existing answers: http://www.codeproject.com/search.aspx?doctypeid=5&q=database+%28image+OR+images+OR+bitmap+OR+bitmaps%29[^].

Good luck,
—SA

查看此链接



http://www.aspsnippets.com/articles/display-images-from-sql-server-database-in-asp.net-gridview-control.aspx [ ^ ]



http://www.aspdotnet-suresh.com/2013/04/display-images-in-aspnet -gridview-from.html [ ^ ]



http://csharpdotnetfreak.blogspot.com/2009/07/display-images-gridview-from-database.html [ ^ ]



希望这些能帮到你......
Check this links

http://www.aspsnippets.com/articles/display-images-from-sql-server-database-in-asp.net-gridview-control.aspx[^]

http://www.aspdotnet-suresh.com/2013/04/display-images-in-aspnet-gridview-from.html[^]

http://csharpdotnetfreak.blogspot.com/2009/07/display-images-gridview-from-database.html[^]

Hope these will help you...


这篇关于将图像从数据网格保存到Sql DataBase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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