Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
i have two datetimepicker as follows;
 
start date time picker and end date time picker.
 
when i click the start date time picker 5 days add and display into end date time picker.
 
for example;
 
start date time picker date always be monday one condition.
 
if i choose 21 st monday on start date time picker and 26th date automatically displayed in the end date time picker.
 
that 5 days date to be saved in the data base.
 
Database Design as follows;
 
Date Date time.
 
Output i want as follows;
 
when i click the start date time picker, in database that 5 days date to be saved in the database.
 
ouput date as follows;
 
21/1/2013
22/1/2013
23/1/2013
24/1/2013
25/1/2013
26/1/2013
 

how can i do using sharp.
Posted 29-Jan-13 2:17am
Comments
Edo Tzumer at 29-Jan-13 8:26am
   
What is the problem? What have you tried?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

code for setting end date time picker date as 5 days+date of start date time picker
 
DateTime dt=startdateTimePicker.Value;
dt=dt.AddDays(5.0);
EnddateTimePicker.Value = dt;
 
// code for gettin dates in between and then u cn store them wherever u want
Datetime startdate=startdateTimePicker.Value;
Datetime enddate=enddateTimePicker.Value;
while(startdate <enddate)>
{
Datetime newdate= startdate.AddDays(1.0);
// now add this date to db using general sql connection statement
 
startdate= newdate;
 
}
 

Hav a gr8 time..
 
vote if it helps u... Smile | :)
  Permalink  
Comments
Marcus Kramer at 30-Jan-13 9:55am
   
My 1. You didn't answer the OP's question at all.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 520
1 OriginalGriff 339
2 ChintanShukla 305
3 Richard Deeming 235
4 RyanDev 230
0 Sergey Alexandrovich Kryukov 8,858
1 OriginalGriff 7,451
2 CPallini 2,603
3 Richard MacCutchan 2,095
4 Abhinav S 1,893


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100