Click here to Skip to main content
15,908,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi gud mrning everyone.
in my website am using two text boxes and 6 labels..
when i enter start date and end date in textbox between start date and end date dates should display in six labels...
for example start date is 10/12/2012 and end date is 15/12/2012 so now in six lables should display date like this
10/12/2012,11/12/2012,12/12/2012........15/12/2012 like this.. can any one suggest me how can i do this coding..
please comment.

thank you..
keep coding
Posted

Hi,

TimeSpan ts = Convert.ToDateTime(txt_Todate.text) - Convert.ToDateTime(txt_Fromdate.text);
int a = ts.Days;
lb11.text=Convert.ToDateTime(txt_Fromdate.text).AddDays(1).ToString();
lb12.text=Convert.ToDateTime(txt_Fromdate.text).AddDays(2).ToString();
 
Share this answer
 
ok here is the sample code..
i m using DateTime Picker instead of textbox.
C#
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            label1.Text = dateTimePicker1.Value.ToShortDateString();
            label2.Text = dateTimePicker1.Value.AddDays(1).ToShortDateString();
    label3.Text=dateTimePicker1.Value.AddDays(2).ToShortDateString();            //do for all 6 lables
        }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900