473,408 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Monthly Repeater for news articles

Hi,

I am trying to display my news articles by month, i am aproaching this
via the use of a nested repeater so that the main rptr will display
the month abnd then using itemdatabound i can pull all articles for
that month.. What i am struggling with is the code to programatically
fill the main repeater with months automatically, any help to achieve
this would be greatly appreciated..

eg:

April 2007
news1
news2
news3
March 2007
news1
news2
news3
Feb 2007
news1
news2
news3
Jan 2007
news1
news2
news3
Dec 2006
news1
news2
news3

Cheers Anthony

Apr 23 '07 #1
3 1343
Where are you getting your list of months? Are you just picking a date, say
January of 2006, and doing every month since then? Or do you have some data
source that has news articles, and you want to display each month for which
there is a news article?

Ray at work

<an***********@googlemail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hi,

I am trying to display my news articles by month, i am aproaching this
via the use of a nested repeater so that the main rptr will display
the month abnd then using itemdatabound i can pull all articles for
that month.. What i am struggling with is the code to programatically
fill the main repeater with months automatically, any help to achieve
this would be greatly appreciated..

eg:

April 2007
news1
news2
news3
March 2007
news1
news2
news3
Feb 2007
news1
news2
news3
Jan 2007
news1
news2
news3
Dec 2006
news1
news2
news3

Cheers Anthony
Apr 23 '07 #2
You want to do a "nested repeater"

http://www.google.com/search?hl=en&q=nested+repeater
Its up to you to fill a DataSet with the correct data.

You might want to use DATEPART to get your articles into different date
ranges.

(if you're using sql server)
<an***********@googlemail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hi,

I am trying to display my news articles by month, i am aproaching this
via the use of a nested repeater so that the main rptr will display
the month abnd then using itemdatabound i can pull all articles for
that month.. What i am struggling with is the code to programatically
fill the main repeater with months automatically, any help to achieve
this would be greatly appreciated..

eg:

April 2007
news1
news2
news3
March 2007
news1
news2
news3
Feb 2007
news1
news2
news3
Jan 2007
news1
news2
news3
Dec 2006
news1
news2
news3

Cheers Anthony

Apr 23 '07 #3

Here's a query for you, using the Northwind database.

You can easily adjust it for news articles.
Select OrderID , OrderDate , datepart(yyyy , OrderDate) as OrderYear ,
datepart(m , OrderDate) as OrderMonth from Orders
WHERE
DATEDIFF ( yyyy , OrderDate , '1/1/1999' ) <=2

ORDER BY
datepart(yyyy , OrderDate) DESC , datepart(m , OrderDate) DESC

"sloan" <sl***@ipass.netwrote in message
news:Oc*************@TK2MSFTNGP03.phx.gbl...
You want to do a "nested repeater"

http://www.google.com/search?hl=en&q=nested+repeater
Its up to you to fill a DataSet with the correct data.

You might want to use DATEPART to get your articles into different date
ranges.

(if you're using sql server)
<an***********@googlemail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hi,

I am trying to display my news articles by month, i am aproaching this
via the use of a nested repeater so that the main rptr will display
the month abnd then using itemdatabound i can pull all articles for
that month.. What i am struggling with is the code to programatically
fill the main repeater with months automatically, any help to achieve
this would be greatly appreciated..

eg:

April 2007
news1
news2
news3
March 2007
news1
news2
news3
Feb 2007
news1
news2
news3
Jan 2007
news1
news2
news3
Dec 2006
news1
news2
news3

Cheers Anthony


Apr 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: VIswanathan S | last post by:
Hi All! How to use Data Repeater in VB.NET? Data Fields are Employee Number Name Photo Date of Joining Salary
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
3
by: Øyvind Isaksen | last post by:
I have a reperater that returns 5 last articles from a given category. In the bottom of the list (in the FooterTemplate) I want to make a link to a page that list all articles in this category....
12
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.