Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Looping through my gridview row, and checking the values of a couple columns in each row.

I have a Notice Column (date) and an EndDate Column (date). What I want to do is: if the notice date for row1 is Today then i want to select the enddate colum value in the same row and add one year to its date, then update the enddate with the new value.

I can get the values of the columns i need, but i'm not exactly sure how to add the year to the date and update it.

can anyone give me a short rundown on how to do this?
Posted
Comments
Member 9581488 20-Dec-12 11:52am    
are you using any event to update grid?
DateTime date = DateTime.Now;
DateTime ans = date.AddYears(1);

You can use this and update grid.
PTG.Jake 20-Dec-12 13:15pm    
I am doing this on button click

1 solution

 
Share this answer
 

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