开发者

add and retriving image from access database in C#

How can I add and retrieve images from Microsoft Access database and also retrieve them using C# WinForms?开发者_开发技巧


Look at using the .net oledb data provider for saving and retrieving blob(binary large object) values in a database.

http://cs.pervasive.com/forums/t/717.aspx


Convert image into byte[] and insert into column of type image. While retrieve check is not null and then read from datareader and typecast into byte[].

 if (dr["Image"] != DBNull.Value && dr["Image"] != null)
                            {
                                Image = (byte[])dr["Image"];
                            } 

From byte[] you can convert into image

Image img;
Image.FromStream(new MemoryStream(m_Image));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜