Click here to Skip to main content
16,004,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi

I have a button "insert" and a dropdownlist filled with days e.g Monday,tuesday etc...When I select monday and press "Insert" the application have to insert values for all the coming mondays for this year.

How can i solve this problem??
Posted
Comments
Herman<T>.Instance 12-Sep-11 9:39am    
what have you tried?
Anele Ngqandu 12-Sep-11 9:57am    
I have tried inserting the values and its working, the problem comes when i have to change the days, I mean for all the coming mondays of this year
OriginalGriff 12-Sep-11 9:44am    
You could try explaining where you are trying to insert days...
Anele Ngqandu 12-Sep-11 9:58am    
The main problem is not an insert, its the mondays,insert values for all the mondays that are left for this year

1 solution

Use a DateTime()[^] object, and keep adding 7 days until the value goes beyond the current year.
 
Share this answer
 
Comments
fjdiewornncalwe 12-Sep-11 11:50am    
Nice. A concise answer that doesn't just dump the code to the OP.
Richard MacCutchan 12-Sep-11 12:00pm    
Well if all we ever did was dump the code we should be getting a cut of their salaries. And thanks for the vote.

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