int days = DateTime.DaysInMonth(int year,int month);
or
int days=System.Globalization.CultureInfo.CurrentCulture.Calendar.GetDaysInMonth(int year,int month);
you have to pass year and month as int
then days in month will be return on currespoting year and month