title: SSRS Report Viewer doesn't detect datasource?
body: <p>I built a very simple report (.rdl) in ReportBuilder 3.0. It has a connection to my database, and gets city out of the address field.</p>
  
  <pre><code>SELECT TOP 10 City, COUNT(City) FROM [MYDB].[dbo].[ResidentialAddress] WHERE StateName = 'WA' OR StateName = 'Washington' GROUP BY City ORDER BY COUNT(City) DESC
  </code></pre>
  
  <p>This works in ReportBuilder. I save and close. Then I try to open and view the report in VS 2010 via MicroSoft.Reporting.WebForms.ReportViewer. I can load a completely blank RDL file (text only) in my c#/ASP.NET website locally.</p>
  
  <pre><code>            this.MyReportViewer.Reset();
              this.MyReportViewer.ProcessingMode = ProcessingMode.Local;
              this.MyReportViewer.AsyncRendering = false;
              this.MyReportViewer.LocalReport.LoadReportDefinition(new StreamReader("H:\\DataReportsViewer\\DataReportsViewer\\" + RDLFileList.SelectedValue));
              this.MyReportViewer.LocalReport.ReportPath = RDLFileList.SelectedValue;          
              this.MyReportViewer.ShowReportBody = true;
              this.MyReportViewer.LocalReport.Refresh();
  </code></pre>
  
  <p>However, as soon as I add a chart, I get this error:</p>
  
  <blockquote>
    <p>A data source instance has not been supplied for the data source
    'DataSet1'.</p>
  </blockquote>
  
  <p>It doesn't make sense to me, because when I open up the RDL file, the connection string and query are there, seemingly as they should be.</p>
  
  <pre><code>&lt;DataSources&gt;
      &lt;DataSource Name="DataSource1"&gt;
        &lt;ConnectionProperties&gt;
          &lt;DataProvider&gt;SQL&lt;/DataProvider&gt;
          &lt;ConnectString&gt;Data Source=MYSERVER;Initial Catalog=Ad_Dev&lt;/ConnectString&gt;
          &lt;IntegratedSecurity&gt;true&lt;/IntegratedSecurity&gt;
        &lt;/ConnectionProperties&gt;
        &lt;rd:SecurityType&gt;Integrated&lt;/rd:SecurityType&gt;
        &lt;rd:DataSourceID&gt;350f6976-9402-43fd-b8f8-8f809f116f84&lt;/rd:DataSourceID&gt;
      &lt;/DataSource&gt;
    &lt;/DataSources&gt;
    &lt;DataSets&gt;
      &lt;DataSet Name="DataSet1"&gt;
        &lt;Query&gt;
          &lt;DataSourceName&gt;DataSource1&lt;/DataSourceName&gt;
          &lt;CommandText&gt;SELECT TOP 10 ResidentialAddress.City,COUNT(ResidentialAddress.City)
  FROM ResidentialAddress
  WHERE StateName = 'WA'
  GROUP BY ResidentialAddress.City
  ORDER BY COUNT(ResidentialAddress.City)&lt;/CommandText&gt;
          &lt;rd:UseGenericDesigner&gt;true&lt;/rd:UseGenericDesigner&gt;
        &lt;/Query&gt;
        &lt;Fields&gt;
          &lt;Field Name="City"&gt;
            &lt;DataField&gt;City&lt;/DataField&gt;
            &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
          &lt;/Field&gt;
          &lt;Field Name="ID"&gt;
            &lt;DataField /&gt;
            &lt;rd:TypeName&gt;System.Int32&lt;/rd:TypeName&gt;
          &lt;/Field&gt;
        &lt;/Fields&gt;
      &lt;/DataSet&gt;
    &lt;/DataSets&gt;
  </code></pre>
  
  <p>So, I attempted the workaround in my c# code:</p>
  
  <pre><code>            //Added line: TestDataSource runs same query and returns correctly loaded DataTable
              ReportDataSource reportDataSource = new ReportDataSource("DataSet1", TestDataSource()); 
              this.MyReportViewer.LocalReport.DataSources.Add(reportDataSource);
  </code></pre>
  
  <p>And that runs, but no data shows up. I can't win! :(</p>
  
  <p>Any ideas? Are SSRS and ASP.NET just not meant to play with each other? I was hoping to make a local test version of this report viewer, but I've already had to make a lot of hacks to even get the blank report to run locally.</p>