Solved

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

Posted on 2009-05-15
2
260 Views
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..
.aspx
 
<asp:Timer ID="uxTimer" Interval="1000" runat="server" />
            <asp:UpdatePanel ID="uxAdRotatorUpdatePanel" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="uxTimer" EventName="Tick" />
                </Triggers>
                <ContentTemplate>        
                    <asp:AdRotator ID="uxAnnouncementsAdRotator" runat="server" 
                                   DataSourceID="uxFrontPageSqlDataSource" />
                </ContentTemplate>
            </asp:UpdatePanel> 
 
<asp:SqlDataSource ID="uxFrontPageSqlDataSource" runat="server"
                   ConnectionString="<%$ ConnectionStrings:infonet %>"
                   SelectCommand="sp_GetFrontPageAnnouncements"
                   SelectCommandType="StoredProcedure" />
 
.cs
 
    protected void Tick(object sender, EventArgs e)
    {
        uxAdRotatorUpdatePanel.Update();
    }
 
stored proc
 
	SET NOCOUNT ON;
	SELECT AlternateTextField, NavigateUrlField, ImageUrlField
	FROM FrontPageAnnouncements 
	WHERE StartDate < getdate() AND EndDate > getdate() 
	ORDER BY OrderID;

Open in new window

0
Comment
Question by:mmedi005
2 Comments
 
LVL 7

Accepted Solution

by:
ajolly earned 500 total points
ID: 24397765
Microsoft provides a good documentation here:
http://msdn.microsoft.com/en-us/library/cc295605.aspx

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.
0
 

Author Comment

by:mmedi005
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?
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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