TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anil john
NA
156
210.4k
adding daya to date
Sep 17 2012 6:00 AM
i am working in windows applicatio, i have two fields startdate and duration, i want to calculate the terminal date,but i get the duration to be added to start date but it will not add sundays to startdate;i am attaching my code, plz help me wat editing i have to do in my code
ma code:
public string FindTerminationDate(DateTime dtStartDate, int iDuration, string strDurationType)
{
string strTermination="";
if (strDurationType == "Days")
{
return strTermination = dtStartDate.AddDays(iDuration).ToString("dd/MMM/yyyy");
}
else if (strDurationType == "Months")
{
return strTermination = dtStartDate.AddMonths(iDuration).ToString("dd/MMM/yyyy");
}
else if (strDurationType == "Years")
{
return strTermination = dtStartDate.AddYears(iDuration).ToString("dd/MMM/yyyy");
}
return strTermination;
}
Reply
Answers (
1
)
How to pass object of a class to stored procedure(in oracle)?
What is Provider in Ado.net