title: Default parameter must be compile-time constant
body: <p>I want to create a method that has optional parameters. The program I am writing needs these to be in DateTime form. My current method declaration is</p>
  
  <pre><code>public void UpdateTable(int month = DateTime.Now.Month, int year = DateTime.Now.Year)
      {
          // Code here.
      }
  </code></pre>
  
  <p>However, I am getting this error "Default parameter value for 'month' must be a compile-time constant."</p>
  
  <p>How can I fix this error? Do I need to set these values outside the method, before calling it?</p>