Is the image name and path in the database? I use a file uploader when uploading images to sites and use the database ID column as the name of the image. Then I can retrieve the image just by using the database ID as below.
SELECT '<img src=/images/compdef/' + CONVERT(varchar,CompDefID) + '.gif height=16 width=16 border=0>' AS CompDefImage FROM [Table]
You could also do this within the itemtemplate of a repeater:
<img border="0" src="/images/compdef/<%#DataBinder.Eval(Container.DataItem,"CompDefID") %>.gif" width="24" height="24" align="absmiddle" alt="<%#DataBinder.Eval(Container.DataItem,"CompAl iasName")%>" />
Substitute your image names and paths.
Good luck!
|