Can't really give you an example until I know exactly how you are trying to go about it but in reality you should only store the path to the image in the database not the image itself, which is what is sounds like you're trying to do at the moment.
I have a page that lets the user upload an image and when they do I create a folder using their username and put the image into that, then I simply take the path to that image and store it in the database. When I display the image I simply take the path to it from the database and assign it to an image control.
Bookmarks