Click here to Skip to main content
12,749,596 members (32,984 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
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
Posted 11-Nov-12 20:49pm
Updated 11-Nov-12 21:16pm
Not clear. What do your try to achieve?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100