Save and Retrieve images from Access Database (mdb file) in ASP.Net using C#

Prasunjeet
 
on Apr 15, 2015 09:52 PM
6824 Views

I have used following code to save image but it shows following error:

Code :

byte[] fileByte = null;
            string path = openFileDialog1.FileName;
            FileStream fs = new FileStream(path,FileMode.Open,FileAccess.Read);
            BinaryReader br = new BinaryReader(fs);
            long allbyte = new FileInfo(path).Length;
            fileByte = br.ReadByte((Int32)allbyte);
            fs.Close();
            fs.Dispose();
            br.Close();

Error :

Error 1 No overload for method 'ReadByte' takes '1' argument

 

please solve above problem and also provide the solution for reading image same as converted via above code

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Mudassar
 
on Apr 17, 2015 07:29 AM

Refer

http://www.mikesdotnetting.com/article/123/storing-files-and-images-in-access-with-asp-net