![]() |
Displaying images from database
How do i display images from my database using asp? The rest of my records are able to be displayed,but the images are not coming out.
what should the datatype for my image field be? At present i have set it at varchar,and entered the value for my image field as "images/cake.jpg" is there anything wrong with this? i just need to extract out and display my images the same way i display others,without having to pass through the ID or something. is that possible? i've seen some websites and they used Response.binarywrite. |
What u need to do is possibly change the datatype to a binary one and use some code (probably from the internet) to read the image as a binary format and use Response.binarywrite to write it to your database.
Similarly, while retrieve u may use Request.binaryread and some other code to display the image as it should be! |
There are two ways to show an image from the data base.
Quote:
<img src="<%=objRs("ImageFieldName")%>"> The other way is the binary write. For that you have to use field type like blob, image depending on the database you are using. I think its a bit slower task so you better use the first type. Thanks |
| All times are GMT -5. The time now is 2:19 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC