SyntaxFix
Write A Post
Hire A Developer
Questions
You can find the last day of the month by a single line of code:
int maxdt = (new DateTime(dtfrom.Year, dtfrom.Month, 1).AddMonths(1).AddDays(-1)).Day;