title: Cannot find table 0 error
body: <p>Cannot find table 0.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <blockquote>
    <p>Exception Details: System.IndexOutOfRangeException: Cannot find table
    0.</p>
  </blockquote>
  
  <p>The error part of the code is " <code>dsReport.Tables[0].Load(drReport);</code>"</p>
  
  <p>And my code for generateReport is :</p>
  
  <pre><code>ReportViewer1.Visible = true;
  ReportViewer1.ProcessingMode = ProcessingMode.Local;
  
  var sqlConnection = new SQLConnectionStrings();
  var conReport = new SqlConnection(sqlConnection.strConn);
  var cmdReport = new SqlCommand();
  
  
  SqlDataReader drReport;
  
  DataSet dsReport = new DataSet();
  //PerfLogDataSet();
  conReport.Open();
  
  cmdReport.CommandType = CommandType.Text;
  cmdReport.Connection = conReport;
  cmdReport.CommandText = baseQuery;
  drReport = cmdReport.ExecuteReader();
  dsReport.Tables[0].Load(drReport);
  drReport.Close();
  conReport.Close();
  
  ReportViewer1.LocalReport.ReportPath = "Report.rdlc";
  ReportViewer1.LocalReport.DataSources.Clear();
  ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dsReport.Tables[0]));
  
  string installTime;
  TimeSpan t = TimeSpan.FromMilliseconds(Convert.ToInt64(PerformanceLogController.deliveryTime.ToString()));
  
  installTime = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms",
                   t.Hours,
                   t.Minutes,
                   t.Seconds,
                   t.Milliseconds);
  
  string UinstallTime;
  TimeSpan tU = TimeSpan.FromMilliseconds(Convert.ToInt64(PerformanceLogController.deliveryTimeU.ToString()));
  
  UinstallTime = string.Format("{0:D2}h:{1:D2}m:{2:D2}s:{3:D3}ms",
                   tU.Hours,
                   tU.Minutes,
                   tU.Seconds,
                   tU.Milliseconds);
  
  ReportParameter p1 = new ReportParameter("testParam", installTime.ToString());
  ReportParameter p2 = new ReportParameter("date", DateTime.Now.ToString());
  ReportParameter p3 = new ReportParameter("filterSum", filter);
  ReportParameter p4 = new ReportParameter("testParam1", UinstallTime.ToString());
  
  this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2, p3, p4 });
  ReportViewer1.LocalReport.Refresh();
  </code></pre>