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 8069675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:07:42+00:00 2026-06-05T13:07:42+00:00

yesterday i asked one question and got the answer from our friend here, and

  • 0

yesterday i asked one question and got the answer from our friend here, and i ran successfully, also it have one problem with it. “Yester day My question is, when we selecting the drop down list then it should be shown by a label as “1” at very first time, again it’ll be increas by selection”, this is what the answer i got..,

static int count = 0;
private void bind()
{ 
    ArrayList ar = new ArrayList();
    ar.Add("first"); 
    ar.Add("Second");
    ar.Add("Third");
    ar.Add("Four");
    ar.Add("Five");
    ar.Add("Six"); 
    ar.Add("Seven");
    CCddl.DataSource = ar;
    CCddl.DataBind();
}

protected void CCddl_SelectedIndexChanged(object sender, EventArgs e)
{
    if (count == 0) count = 1;
        Label12.Text = count++.ToString(); 
}

this code worked, but once the running window getting closed, then it lose the continuation, i mean again application getting run it’ll shown again “1”. But exactly what i want is, the number continuation should be end when the system day has change.

  • 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-05T13:07:45+00:00Added an answer on June 5, 2026 at 1:07 pm

    Try using the Application Settings feature. I added two user settings CountDate and Count in the Project->Property’s->Settings and changed your SelectedIndexChangedEvent to

    protected void CCddl_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (count == 0) count = 1;
            Label12.Text = count++.ToString();
    
        Properties.Settings.Default.CountDate = DateTime.Now.Date;
        Properties.Settings.Default.Count = count;
        Properties.Settings.Default.Save();
    } 
    

    And right before you call your Bind Method during your form initialization put something like this.

     if(Properties.Settings.Default.CountDate.Date != DateTime.Now.Date)
     {
        Properties.Settings.Default.Count = 0;
        Properties.Settings.Default.CountDate = DateTime.Now.Date;
        Properties.Settings.Default.Save();
     }
     else
        count = Properties.Settings.Default.Count;
    
     bind();
    

    Added the Property Settings Image

    enter image description here

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

Sidebar

Related Questions

Yesterday my friend asked me a question about this query: select * from user
Following the question I had asked yesterday which is here passing contents from multiple
A follow on from the question I asked yesterday. I have a paging scrollView
Yesterday I asked this general question about decimals and their internal precisions. Here is
Yesterday I asked about serving byte ranges from PHP. Today my question is -
This is linked to a question I asked yesterday. Briefly, the problem I'm having
As an answer to a question I asked yesterday ( New Core Data entity
this is an interview question my friend was asked yesterday. The question was something
So I asked this question yesterday, but the goal posts have changed and the
This problem is related to This question I asked yesterday. Now it seems that

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.