Jump to content

how to display image saved in access database


vadder85

Recommended Posts

hi, does any one know how to display image saved in access database? FYI, i managed to saved in access using Ole Object but later got problem when want to display the image saved before.Any idea?
This article might help: http://www.codeproject.com/aspnet/image_asp.aspThe article was written for MySQL database, but it should help for any DBMS. The key point is when you get the data from the database, you'll use the Bitmap class to create a bitmap from a MemoryStream and send that bitmap to the browser:From the article:
byte []buffer = data.getImage(imagenumber); System.IO.MemoryStream stream1 = new System.IO.MemoryStream(buffer,true); stream1.Write(buffer,0,buffer.Length); Bitmap m_bitmap = (Bitmap) Bitmap.FromStream(stream1,true); Response.ContentType = "Image/jpeg"; m_bitmap.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
Link to comment
Share on other sites

This article might help: http://www.codeproject.com/aspnet/image_asp.aspThe article was written for MySQL database, but it should help for any DBMS. The key point is when you get the data from the database, you'll use the Bitmap class to create a bitmap from a MemoryStream and send that bitmap to the browser:From the article:
Does your solution works in .net mobile?
Link to comment
Share on other sites

Does your solution works in .net mobile?
I don't know, I've never used .NET Mobile. Can you use the System.Drawing and System.Web namespaces? If so, then it should probably work.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...