Click here to Skip to main content
14,700,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have grid view and in the template field of grid view i have image control
and this control bind from sql server database 2005
i retrieve this image from sql server database 2005 in the table image column have only image name insert not image url
<asp:Image ID="Image1" runat="server" ImageUrl ='<%# Eval("Logo") %>'>

but image not retrieve by image control
Updated 11-Nov-12 21:16pm
Not clear. What do your try to achieve?

1 solution

Dude,as per my understanding..only the image name is stored in the database but the imageurl.So only with the image name you cannot get the image from database.Also bind the image path to the Imageurl as shown below.

ImageUrl='<%# String.Format("~/path/to/image/" + Eval("product_img")) %>'

Replace ~/path/to/image/ with the path where the images are stored.

Mas11 12-Nov-12 6:33am
Good Answer !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900