开发者

add and retriving image from access database in C#

开发者 https://www.devze.com 2022-12-21 23:19 出处:网络
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(binar

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

精彩评论

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