Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:13:47+00:00 2026-06-13T20:13:47+00:00

I am working with an application written in C# which handles an agenda where

  • 0

I am working with an application written in C# which handles an agenda where every day can have some related information. For simplicity reasons, let’s define a Day object like the following:

public class Day
{
    public DateTime date { get; set; }
    public List<string> info { get; set; }
}

There’s a function that, given a starting date, will return a list containing all Days in the next week which have some information. Days in the next week that have info.Count = 0 are not in the returned list. Therefore, we can expect to obtain a List object with size 7 or less. Now, I have the following problem:

I want to show all seven days, whether or not they are on the obtained list.

The easy (and inefficient) solution I came up with is to code a function that takes the obtained List, reads it and adds the missing days (if any) into it. This way we always have a list with size 7 and can happily populate an asp:Repeater with it. But I think there is a better way to do this:

It is known in advance that the system has to display the next consecutive seven days starting from the given date. It shouldn’t be necessary to have the complete List to display the data. My question is, how can this be done? Am I going into the bad direction by doing this with a repeater?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:13:48+00:00Added an answer on June 13, 2026 at 8:13 pm

    I don’t see why adding the missing days is particularly inefficient. You’re talking milliseconds, if that. And it simplifies the rest of the code. Otherwise you’ll have to hand-code most of what a repeater does.

    Sounds to me like you should go ahead and add the missing days to the list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a web application written on php. I have some objects (represented
I have written a GUI application which after performing some analyses on a large
I have a working WinForms application, written in c#, which is divided in several
Working with the Google Web Toolkit i have written an application which is based
I'm currently working on an application written in C#, which I'm embedding IronPython in.
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the
I'm working on a C++ application which uses a library written in C by
I am currently working on a large scale application project (written in c++) which
I'm working on a ASP.NET MVC3 web application (not written by me) which has
I am working on a CMS application which has been written in procedural style

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.