Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 28th, 2004, 05:46 AM
Authorized User
Join Date: Sep 2004
Location: , , .
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.


  #2 (permalink)  
Old September 28th, 2004, 05:50 AM
Authorized User
Join Date: Sep 2004
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts

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

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

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">
<asp:Image id="StockImage" runat="server" ImageUrl="images/" & '<%# DataBinder.Eval(Container.DataItem, "ImageName") %>'></asp:Image>


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 08:06 PM.

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