title: "Some parameters or credentials have not been specified" when updating a LocalReport parameter and refreshing it -- only when done quickly --
body: <p>I have a WinForm (MVP) application, in which I have to show a LocalReport in a ReportViewer and update it using some textbox/numericUpDown.</p>
  
  <p>The LocalReport just needs parameters, every input is setting a parameter.</p>
  
  <p>This is the code where I set the LocalReport in the form:</p>
  
  <pre><code> public LocalReport ReportToShow
      {
          set
          {
              //http://stackoverflow.com/questions/9200308/vs2010-rdlc-c-how-can-i-set-a-localreport-object-to-a-reportviewer
              //assign report Path
              reportViewer.LocalReport.ReportPath = value.ReportPath;
  
              //get a list of actual parameters in the report, with the value set @ String.Empty
              var newParams = value.GetParameters().Select(t =&gt; new ReportParameter(t.Name, String.Empty)).ToList();
  
              reportViewer.LocalReport.SetParameters(newParams);
  
  
  
              //show the report for the first time
              reportViewer.RefreshReport();
          }
      }
  </code></pre>
  
  <p>And this is the code that <strong><em>sometimes</em></strong> (will explain below) causes the exception:</p>
  
  <pre><code>private void UpdateParam(String name, String value)
      {
          reportViewer.LocalReport.SetParameters(new[] {new ReportParameter(name, value)});
          reportViewer.LocalReport.Refresh();
      }
  </code></pre>
  
  <p>This method is bound to the TextChanged/ValueChanged event of my inputs. Basically, every time a input changes the report is refreshed.</p>
  
  <p>This is the exception:
  <img src="https://i.stack.imgur.com/XWvwU.png" alt="Exception"></p>
  
  <p>Note that the report has just 2 parameters now, and both are set. No datasource needed.</p>
  
  <p>Why <strong><em>sometimes</em></strong>:</p>
  
  <ul>
  <li>The exception is thrown the first time I show the form, since I programmaticaly update the textbox/numericupdown, and the events are fired "quickly".</li>
  <li>The exception is thrown when i type 2 strokes in the same time or even when I type <em>really</em> quick.</li>
  <li>The exception is <strong>not</strong> thrown when I type normally in the inputs.</li>
  </ul>
  
  <p>The idea I have is that the reportViewer.RefreshReport() is async internally and when a event is fired before the completation, it will cause an exception.</p>
  
  <p>Other things you may be interested:</p>
  
  <ul>
  <li>Stack trace:
  <img src="https://i.stack.imgur.com/dRXH9.png" alt="Stack trace, looks like async"></li>
  <li><strong>Even if the exception is thrown, the report is rendered correctly!</strong></li>
  </ul>
  
  <p>Debugging is becoming hell, any suggestion? Thanks</p>