Adrotator control.. programming

Discussion in 'ASP .Net Web Controls' started by Aussie Rules, Jun 4, 2007.

  1. Aussie Rules

    Aussie Rules Guest

    Hi,
    I have a adrotator control on a page, and want to program the connection of
    the control via SQL.

    I have the following code, but not sure what else to do?


    Dim SQLServerConnection As SqlConnection
    Dim SqlConnectionCls As New clsSQL
    SQLServerConnection = SqlConnectionCls.Connect

    Dim SqlCommand As New SqlCommand

    With SqlCommand
    .CommandType = Data.CommandType.StoredProcedure
    .Connection = SQLServerConnection
    .CommandTimeout = 15
    .CommandText = "sproc_GetAddDetails"
    End With

    Me.AdRotator1.DataSource = SqlCommand

    AdRotator1.ImageUrlField = "advert_image"
    AdRotator1.NavigateUrlField = "advert_URLlink"
    Aussie Rules, Jun 4, 2007
    #1
    1. Advertising

  2. Hi Aussie,

    Regarding on this issue, I have also seen your another one in the following
    newsgroup:

    Subject: Adrotator
    Newsgroups: microsoft.public.dotnet.framework.aspnet

    Community member Alexey and I have posted some suggestion there. Please
    have a look and feel free to followup in that thread if you have any
    further questions.

    Thanks for your posting!

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Jun 5, 2007
    #2
    1. Advertising

  3. Aussie Rules

    Aussie Rules Guest

    Hi Steven,

    Thanks for your reply.

    I am still not able to get this to work. My code is as follows. When I view
    source of the HTML page, there are no values for the adrotator at all.
    The Stored Proc works fine.


    Try

    Dim SQLServerConnection As SqlConnection
    Dim SqlConnectionCls As New clsSQL
    SQLServerConnection = SqlConnectionCls.Connect
    Dim SqlCommand As New SqlCommand

    With SqlCommand

    .CommandType = Data.CommandType.StoredProcedure
    .Connection = SQLServerConnection
    .CommandTimeout = 15
    .CommandText = "sproc_GetBannerAdvertDetails"

    End With

    ' I have swapped these arround and tried, but not working. I have put the
    image/navurl after the databind.

    AdRotator1.ImageUrlField = "advert_image"
    AdRotator1.NavigateUrlField = "advert_URLlink"
    AdRotator1.DataSource = SqlCommand.ExecuteReader
    AdRotator1.DataBind()

    Catch ex As Exception


    End Try




    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Aussie,
    >
    > Regarding on this issue, I have also seen your another one in the
    > following
    > newsgroup:
    >
    > Subject: Adrotator
    > Newsgroups: microsoft.public.dotnet.framework.aspnet
    >
    > Community member Alexey and I have posted some suggestion there. Please
    > have a look and feel free to followup in that thread if you have any
    > further questions.
    >
    > Thanks for your posting!
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    Aussie Rules, Jun 5, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon
    Replies:
    2
    Views:
    673
    Andy Lim
    Nov 15, 2004
  2. Aussie Rules
    Replies:
    1
    Views:
    409
    Mark Fitzpatrick
    Oct 2, 2007
  3. MC
    Replies:
    6
    Views:
    651
  4. Ertan Sekmen

    adrotator control

    Ertan Sekmen, Aug 6, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    139
    Ertan Sekmen
    Aug 7, 2003
  5. Rémy BUR

    lilitations of AdRotator Control

    Rémy BUR, Apr 26, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    96
    Rémy BUR
    Apr 26, 2004
Loading...

Share This Page