Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How do I set up a AdRotator Control with a SqlDataSource?

Posted on 2009-05-15
Medium Priority
Last Modified: 2013-12-17
How do I set up a AdRotator Control with a SqlDataSource?

this is what i have...can you tell me what I'm dong wrong?

see attached..
<asp:Timer ID="uxTimer" Interval="1000" runat="server" />
            <asp:UpdatePanel ID="uxAdRotatorUpdatePanel" runat="server">
                    <asp:AsyncPostBackTrigger ControlID="uxTimer" EventName="Tick" />
                    <asp:AdRotator ID="uxAnnouncementsAdRotator" runat="server" 
                                   DataSourceID="uxFrontPageSqlDataSource" />
<asp:SqlDataSource ID="uxFrontPageSqlDataSource" runat="server"
                   ConnectionString="<%$ ConnectionStrings:infonet %>"
                   SelectCommandType="StoredProcedure" />
    protected void Tick(object sender, EventArgs e)
stored proc
	SELECT AlternateTextField, NavigateUrlField, ImageUrlField
	FROM FrontPageAnnouncements 
	WHERE StartDate < getdate() AND EndDate > getdate() 

Open in new window

Question by:mmedi005
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

ajolly earned 2000 total points
ID: 24397765
Microsoft provides a good documentation here:

Also, notice that you will get a lot of examples for using ad rotator with .xml files.
and you can convert a datatable at any point of time in a xml file.

Author Comment

ID: 24398631
only reason I use a sqldatasource is because it lets the user put a life cycle to the ad's.  The SQL statement conditions only SELECT the ones that haven't ended.  

Can I input this in an xml?

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question