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

  • Home
  • SEARCH
  • 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 8883255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:46:14+00:00 2026-06-14T20:46:14+00:00

I am using this code for display dates from current date to next six

  • 0

I am using this code for display dates from current date to next six days.
if any other code for display date like this. please help

Private Sub Displaydate()
    cn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("DataConnectionString")
    lblDateday.Text = System.DateTime.Now.ToString("dddd")
    lblMonthdate.Text = System.DateTime.Now.ToString("dd MMMM ")
    lblDateday2.Text = System.DateTime.Now.AddDays(1).ToString("dddd")
    lblMonthdate2.Text = System.DateTime.Now.AddDays(1).ToString("dd MMMM ")
    lblDateday3.Text = System.DateTime.Now.AddDays(2).ToString("dddd")
    lblMonthdate3.Text = System.DateTime.Now.AddDays(2).ToString("dd MMMM ")
    lblDateday4.Text = System.DateTime.Now.AddDays(3).ToString("dddd")
    lblMonthdate4.Text = System.DateTime.Now.AddDays(3).ToString("dd MMMM ")
    lblDateday5.Text = System.DateTime.Now.AddDays(4).ToString("dddd")
    lblMonthdate5.Text = System.DateTime.Now.AddDays(4).ToString("dd MMMM ")
    lblDateday6.Text = System.DateTime.Now.AddDays(5).ToString("dddd")
    lblMonthdate6.Text = System.DateTime.Now.AddDays(5).ToString("dd MMMM ")
    lblDateday7.Text = System.DateTime.Now.AddDays(6).ToString("dddd")
    lblMonthdate7.Text = System.DateTime.Now.AddDays(6).ToString("dd MMMM ")
End Sub

the output is

Wednesday Thursday Friday Saturday Sunday Monday Tuesday

21 November 22 November 23 November 24 November 25 November 26 November 27November

  • 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-14T20:46:16+00:00Added an answer on June 14, 2026 at 8:46 pm

    Put the things you handle into arrays and then do loops instead.

    Assign Lists globally

    Dim DateDayList as List(of Label) = new List(of Label)
    Dim MonthDayList as List(of Label) = new List(of Label)
    

    Add all dateDay labels to list in the correct order inside the Initialize sub.

    DateDayList.Add(lblDateDay)
    DateDayList.Add(lblDateDay2)
    etc.
    

    Do the same with the Month day labels.

    Then simply do this:

    for i as Integer = 0 To 6
       DateDayList(i).Text = System.DateTime.Now.AddDays(i).ToString("dddd")
       MonthDayList(i).Text = System.DateTime.Now.AddDays(i).ToString("dd MMMM ")
    next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code to display a grid $('#table1 tr').bind('click', shows); function shows()
I am using this code in wordpress to display different content when different pages
I'm working on some HTML5 demo code, including stuff like <input type=date /> This
So I'm using this code to get the last entry for each day from
I've been using this code to try and get data from the google weather
I am new in list view . I am using this code to display
I am trying to display the date on android emulator browser. The current code
Using this code, i am able to send a notification to my own device.
Using this code to zip a folder and it works perfect on small files
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:

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.