Using images in Phots for an adrotator control RRS feed

  • Question

  • User-353711098 posted

    Lets assume that on the front page of my club website I want to have an adrotator that rotates through the different pictures that appear in the Photos section.

    From what I understand, the adrotator will get its information from either an xml file, or from a table that follows a particular schema.

    I have created a table in my SQL Server database to hold the information, according to specifications, but do not know how to set the ImageUrl field, since the image is in the images table and not physically on the server's file system.

     Any suggestion will be appreciated!


    Sunday, January 7, 2007 8:39 PM

All replies

  • User-353711098 posted

    I have solved the problem:

    I created this table as my DataSource: Works well! Let me know if it helps you too!

    CREATE TABLE [dbo].[AdRotatorData](

    [ID] [int] IDENTITY(1,1) NOT NULL,

    [ImageUrl] AS ('imagefetch.ashx?size=0&imageid='+ltrim(str([imageid]))),

    [NavigateUrl] AS ('Info.aspx?imageid='+ltrim(str([imageid]))),

    [AlternateText] [varchar](35) COLLATE Latin1_General_CI_AS NULL CONSTRAINT [DF_AdRotatorData_AlternateText] DEFAULT (N'Click Here to view this image'),

    [Keyword] [varchar](50) COLLATE Latin1_General_CI_AS NULL,

    [Impressions] [int] NULL CONSTRAINT [DF_AdRotatorData_Impressions] DEFAULT ((1)),

    [Width] [int] NULL CONSTRAINT [DF_AdRotatorData_Width] DEFAULT ((470)),

    [Height] [int] NULL CONSTRAINT [DF_AdRotatorData_Height] DEFAULT ((353)),

    [imageid] [int] NULL

    ) ON [PRIMARY]


    Monday, January 8, 2007 4:44 PM
  • User-950506418 posted


    It works!

    Saturday, June 9, 2007 11:24 AM
  • User-353711098 posted

    WOW! I had forgotten that I had posted my solution.

    I am glad it helped somebody else too!


    Saturday, June 9, 2007 1:02 PM
  • User2041355700 posted


    I hope you can help me im using the club starter kit which is working really good but i just need to add one little function to it.  The photo section you can use the next button or the previous button to see the images, i want to add another button so it will play all the images in that abum like a slide show, so you dont have to keep pressing the button, can anyone help me please...



    Saturday, June 16, 2007 11:26 AM
  • User-353711098 posted

    Hi dips:

     By coincidence, yesterday I was afters something very similar to what you want, and I found this codeproject contribution, that does what you want:



    Saturday, June 16, 2007 7:28 PM
  • User191166489 posted

    dear DBS253

    will you please post the complete solution how u have connected with front end asp.net

    also will u pls post me the sample data thru select command as am struggling to insert data

    just show me the data thru "select * from AdRotatorData"

    thanx a lot



    Thursday, May 15, 2008 10:16 AM
  • User-353711098 posted

    <asp:SqlDataSource ID="SqlDataRotator" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"

    SelectCommand="SELECT ImageUrl, NavigateUrl, AlternateText, Keyword, Impressions, Width, Height, imageid FROM vwAdRotatorData">


    Thursday, May 15, 2008 4:50 PM
  • User191166489 posted

    dear dabas

    thanx for your reply but with this table script am unable to understood the following as till now am managing with XML this adrotator but its very difficult to modify for new ads hence am trying to convert my project with database.

    pls clear me the doubts for the following 3 lines

    1) for ImageUrl and NavigateUrl what will be data type. Here your data type I have not understood

    2) also have noticed that u have assigned one imageid and referring into ImageUrl n NavigateUrl.

    Please help me the following 2

    [ImageUrl] AS ('imagefetch.ashx?size=0&imageid='+ltrim(str([imageid]))), <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[NavigateUrl] AS ('Info.aspx?imageid='+ltrim(str([imageid]))), <o:p></o:p>[imageid] [int] NULL <o:p></o:p>


    for xml am doing this 2 like the following way



    Friday, May 16, 2008 3:45 AM