Check the Given date is sunday or not...,
-
Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007
Magi
-
Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007
Magi
Hi, you could try.
if(DayOfWeek.Sunday.CompareTo(YourDate.DayOfWeek) == 0) { ... }
the CompareTo function returns either "-1" = false or "0" = true. hope this helps greetings pdluke -
Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007
Magi
VB Code -.net 2.0 ------- Dim dateobj As Date dateobj = Now If( dateobj.DayOfWeek = DayOfWeek.Sunday) Then textbox1.Text=CInt(textbox2.Text) + CInt(textbox3.Text) Else textbox1.Text=CInt(textbox2.Text) + CInt(textbox4.Text) End If C# Code-.net 2.0 ------- DateTime dateobj; dateobj = DateTime.Now; if( dateobj.DayOfWeek == DayOfWeek.Sunday) { textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox3.Text) } else { textbox1.Text=Convert.ToInt32(textbox2.Text) + Convert.ToInt32(textbox4.Text) }
-
Hi i want to check the given date is sunday or not like..., Suppose if its sunday it want to execute some conditions otherwise it want to do some other condition..., how to do that one? Plz help me...., example: i have 4 textbox each have some values..., If the given date will be sunday it want to add textbox 2 & 3 and store it in textbox 1 else,if its weekday then it want to add textbox 2 & 4 and store the value in textbox 1 how to do that plz any one help me..., -- modified at 4:30 Wednesday 30th May, 2007
Magi
hi there is a property called IsWeekend property I got some information from net i wil give u the link it is http://www.ucertify.com/articles/70-305/What-is-the-IsWeekend-property.html check whether its of any use 4 u or not.
Prakash Mishra(Banglore,India)