Images not displayed from Database ASP.NET C#

78 Views Asked by At

I am trying to display advertisement using "AdRotator" and retrieving the images from Database. Unfortunately, the image is not appearing. I double checked the URL path and everything looks intact. Not sure what I had missed, maybe a second pair of eyes can help? Attached below are my codes and database schema.

Advertisement_Banners

CREATE TABLE [dbo].[Advertisement_Banners] 
(
    [AID]           INT IDENTITY (1, 1) NOT NULL,
    [ImageUrl]      NCHAR(100) NULL,
    [NavigateUrl]   NCHAR(100) NULL,
    [AlternateText] NCHAR(100) NULL,
    [Keyword]       NCHAR(100) NULL,
    [Impressions]   INT        NULL,
    [Width]         INT        NULL,
    [Height]        INT        NULL,

    PRIMARY KEY CLUSTERED ([AID] ASC)
)

Advertisement_Banner (sample data)

enter image description here

WebForm1.aspx

<center>
    <asp:AdRotator ID="AdRotator1" runat="server" Target="_blank" 
         Width="100%" Height="50%" DataSourceID="SqlDataSource1" />
</center>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
     ConnectionString="<%$ ConnectionStrings:ConnStr %>" 
     SelectCommand="SELECT * FROM [Advertisement_Banners]">
</asp:SqlDataSource>

F12 Console Tab Error

0

There are 0 best solutions below