How to Fetch and Display an Image from the Database in ASP.Net and C#

There are so many good tutorials out there about inserting an image inside a table in a database, using the FileUpload controller.Yet I cannot find a good tutorial about how to fetch these images and display them.When I used to store the image name or path in the database (as a Varchar), It would be very simple by doing something like this...HTML/ASP:\[code\]<img src="" runat="server" id="myImage" />\[/code\]C#:\[code\]myImage.Src = http://stackoverflow.com/questions/14034779/myReader.getValue(0).toString();\[/code\]The Result:\[code\]<img src="http://stackoverflow.com/Images/pic.png" runat="server" id="myImage" />\[/code\]And Voila, the picture will be displayed.But Now I would like to fetch uploaded images, not a path, means the type of the table column is IMAGE.Some tutorials will eventually lead to display a picture in FULL SCREEN.I do not want that, I simply want to fetch and display the image the same way it is displayed in the previous example, with a given size and place inside my web page.Why am I uploading images to the database? Because these images are "Profile Pictures", not public pictures, I do not want a guest to simply browse for /Images/ to find all the pictures of my web site, public and private.
 
Back
Top