I have a sql server database that returns byte for the image. If I use the tableadapter wizard and set it to my stored procedure and preview data, it pulls back an image.
The sample code you added is good but you should move it to a .ashx file which is meant for such things.
.ashx