I have a method which passes two parameters Month and year
i will call this Method like this : MonthDates(January,2010)
public static string MonthDa
If you want all days as a collection of DateTime:
DateTime
public static IEnumerable daysInMonth(int year, int month) { DateTime day = new DateTime(year, month, 1); while (day.Month == month) { yield return day; day = day.AddDays(1); } }
The use is:
IEnumerable days = daysInMonth(2010, 07);