Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2004, 05:46 AM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default images in sql server

Hi Guys

I'm trying to display an asp.net page which shows products with images relating to each product. I have a sql server table which stores all these products and at the moment the image name is stored not the actual image. I'm having trouble getting my image to display in a datagrid. I can create bound columns and display all my product info and I can create a template column that can display an image but I don't know how to display a different image for each product (ie I don't know how to retrieve the image name from the table and use that image name in the template column of my data grid).

All very confusing so any help would be much appreciated.

Thanks

 
Old September 28th, 2004, 05:50 AM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry.. I should give you the code I'm using at the moment:

<asp:TemplateColumn HeaderText="Image">
<ItemTemplate>
<asp:Image id="StockImage" runat="server" ImageUrl="images/fridge.jpg"></asp:Image>
</ItemTemplate>
</asp:TemplateColumn>

Instead of hard coding the name of the image (images/fridge.jpg) in the ImageURL I tried this (below) but got error message.

<asp:TemplateColumn HeaderText="Image">
<ItemTemplate>
<asp:Image id="StockImage" runat="server" ImageUrl="images/" & '<%# DataBinder.Eval(Container.DataItem, "ImageName") %>'></asp:Image>
</ItemTemplate>
</asp:TemplateColumn>







Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display sql server images in asp.net c# bobwith5 ASP.NET 2.0 Basics 0 October 20th, 2007 11:07 AM
update& retrieval of images from sql server.. preetham.sarojavenkatesh ASP.NET 2.0 Basics 5 August 7th, 2007 12:07 PM
Retrieving Images from SQL Server jazzcatone ASP.NET 1.0 and 1.1 Professional 1 September 19th, 2006 11:33 AM
Inserting & Retrieving Images on Sql Server adamusufi SQL Server 2000 6 June 26th, 2005 03:32 PM
Inserting Images and retrieving from SQL SERVER adamusufi VB.NET 2002/2003 Basics 0 June 24th, 2005 04:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.