1
Answer

'Incompatible' project in visual 2013

Photo of Methoun Ahmed

Methoun Ahmed

7y
137
1
I am developing a project thats project use C#,sqlserver 2012,Visual Studio 2013 and operating systemis windows 7.Now i am use windows 10 and  sqlserver 2012,Visual Studio 2013 but when i am open my project show error 'Incompatible' and project files not open properly.how to solve the problem.
 

Answers (1)

0
Photo of Vulpes
NA 98.3k 1.5m 12y
Here is some basic code to work out the number of working days (Monday to Friday) in any given month and year:

      int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
      int month = 6; // June
      int year  = 2012;
      if (DateTime.IsLeapYear(year)) daysInMonth[1] = 29;
      DateTime dt = new DateTime(year, month, 1);
      int workingDays = 0;
      
      for(int i = 1; i <= daysInMonth[month - 1]; i++)
      {
         if(dt.DayOfWeek != DayOfWeek.Sunday && dt.DayOfWeek != DayOfWeek.Saturday) workingDays++;
         dt = dt.AddDays(1);
      }

      label1.Text = workingDays.ToString(); // 21

If you want to regard Saturday as a working day, then just change this line:

    if(dt.DayOfWeek != DayOfWeek.Sunday && dt.DayOfWeek != DayOfWeek.Saturday) workingDays++;

to this:

    if(dt.DayOfWeek != DayOfWeek.Sunday) workingDays++;