DateTimePicker
-
Hi, I am creating an applicatio that creates databases on the date provided. I have a problem. I am using datetimepicker for selecting the date. I need the application to create the database if teh day of the selected date is Thursday only.Otherwise it should show a message box saying "The selecetd day is not Thursday Do you want to continue or not". How can i do this? public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } The above mentioed code takes the month and day. My datetime picker display is like Thursday February 28,2008 Planning to do it like if in the datetimepicker if its Thursday ,then it will go to a if statement and show the message box. But my problem is how can i read that it is a thursday from datetime picker. Thanking You,
-
Hi, I am creating an applicatio that creates databases on the date provided. I have a problem. I am using datetimepicker for selecting the date. I need the application to create the database if teh day of the selected date is Thursday only.Otherwise it should show a message box saying "The selecetd day is not Thursday Do you want to continue or not". How can i do this? public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } The above mentioed code takes the month and day. My datetime picker display is like Thursday February 28,2008 Planning to do it like if in the datetimepicker if its Thursday ,then it will go to a if statement and show the message box. But my problem is how can i read that it is a thursday from datetime picker. Thanking You,
Trustapple wrote:
how can i read that it is a thursday from datetime picker.
Look at this[^] And then this[^]
led mike
-
Hi, I am creating an applicatio that creates databases on the date provided. I have a problem. I am using datetimepicker for selecting the date. I need the application to create the database if teh day of the selected date is Thursday only.Otherwise it should show a message box saying "The selecetd day is not Thursday Do you want to continue or not". How can i do this? public string GetDatabasename() { string namedatabase = dateTimePicker1.Value.ToString("MMdd"); string nameDB = "CustList_PGE_" + namedatabase; MessageBox.Show("The name of the database will be CustList_PGE_" + namedatabase); return nameDB; } The above mentioed code takes the month and day. My datetime picker display is like Thursday February 28,2008 Planning to do it like if in the datetimepicker if its Thursday ,then it will go to a if statement and show the message box. But my problem is how can i read that it is a thursday from datetime picker. Thanking You,
-
Trustapple wrote:
how can i read that it is a thursday from datetime picker.
Look at this[^] And then this[^]
led mike
Thanks Mike. I did like this if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("The selected date is Thursday")) { MessageBox.Show("Thursday"); } else MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo); } I have one more doubt; Is it possible for me to stop the process if i click on "No" in the message box? If yes How? Thanking You,
-
Thanks Mike. I did like this if (dateTimePicker1.Value.DayOfWeek.ToString().Equals("The selected date is Thursday")) { MessageBox.Show("Thursday"); } else MessageBox.Show("The selected date is not Thursday,Do you want to continue?", "Options", MessageBoxButtons.YesNo); } I have one more doubt; Is it possible for me to stop the process if i click on "No" in the message box? If yes How? Thanking You,
-
J4amieC wrote:
This really is all in the documentation.
No!!! Not the documentation!! How cruel of them to put the answers there. ;)
only two letters away from being an asset