473,468 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB.NET Web-App: ImageField not displaying image in GridView

2 New Member
Hi, I'm new to the community (1st post) so I hope I didn't leave anything out.
I have a gridview (grdPics) created with 1 Imagefiled (picname) which contains the URL to where the image is stored.

asp code...
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="grdPics" runat="server" Height="136px" Style="z-index: 133; left: 32px;
  2.             position: absolute; top: 600px" Width="464px" AutoGenerateColumns="False">
  3.             <Columns>
  4.                 <asp:ImageField DataImageUrlField="picname">
  5.                 </asp:ImageField>
  6.             </Columns>
  7.         </asp:GridView>
  8.  
vb.net code
Expand|Select|Wrap|Line Numbers
  1. sql = ("SELECT RTrim(qpicname) as picname FROM MYFILE where quote# = '" & strQuote & "'")
  2.             cmd = New iDB2Command(sql, cn)
  3.             da.SelectCommand = cmd
  4.             da.Fill(ds, "Pics")
  5.             grdPics.DataSource = ds
  6.             grdPics.DataMember = "Pics"
  7.             grdPics.DataBind()
  8.  
When the gridview displays I just have the red x where the picture should be.
Things I've checked...
- Picture does exist in the folder where the URL is pointing
- SQL command is correct and does bring back the data expected.

What else did I miss??? I'm sure it's something simple.
Any Help would be appreciated.
Dec 13 '07 #1
2 2854
Raiders8180
2 New Member
Any suggestions on what else I can try/test...
Dec 14 '07 #2
Frinavale
9,735 Recognized Expert Moderator Expert
Hi, I'm new to the community (1st post) so I hope I didn't leave anything out.
I have a gridview (grdPics) created with 1 Imagefiled (picname) which contains the URL to where the image is stored.

asp code...
Expand|Select|Wrap|Line Numbers
  1. <asp:GridView ID="grdPics" runat="server" Height="136px" Style="z-index: 133; left: 32px;
  2.             position: absolute; top: 600px" Width="464px" AutoGenerateColumns="False">
  3.             <Columns>
  4.                 <asp:ImageField DataImageUrlField="picname">
  5.                 </asp:ImageField>
  6.             </Columns>
  7.         </asp:GridView>
  8.  
vb.net code
Expand|Select|Wrap|Line Numbers
  1. sql = ("SELECT RTrim(qpicname) as picname FROM MYFILE where quote# = '" & strQuote & "'")
  2.             cmd = New iDB2Command(sql, cn)
  3.             da.SelectCommand = cmd
  4.             da.Fill(ds, "Pics")
  5.             grdPics.DataSource = ds
  6.             grdPics.DataMember = "Pics"
  7.             grdPics.DataBind()
  8.  
When the gridview displays I just have the red x where the picture should be.
Things I've checked...
- Picture does exist in the folder where the URL is pointing
- SQL command is correct and does bring back the data expected.

What else did I miss??? I'm sure it's something simple.
Any Help would be appreciated.
Is the folder where your pictures are located in your web application's root directory?

You have to make sure that the folder is on the Web Server (IIS... wwwroot folder)so that the web browsers can access the photos. They can't be located on any folder on the computer.
Dec 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
2
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
8
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
0
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
2
by: Anna | last post by:
I added a small Web.Config file to the root of my website so that I could view errors on a machine other than the server: <configuration> <system.web> <customErrors mode="Off" /> </system.web>...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
7
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.