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));
精彩评论