Click here to Skip to main content
12,758,323 members (32,021 online)
Rate this:
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;


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

1 solution

Rate this: bad
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;
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... :)
Marcus Kramer 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
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