title: binding/rebinding datasource to reportviewer vb.net at runtime
body: <p>i have a reportviewer in vb.net and i have 2 .rdlc files namely Report1 and Report2.
  they have both the same design as a table but Report1 has parameter and filter, Report2 just displays everything from my record.</p>
  
  <p>i know how to bind datasources to reportviewer at design time but i don't know how to do it run time, i need switching of datasources when the form loads the first time and when the user actually search something. basically this is what i have in mind.</p>
  
  <p><a href="http://imageshack.us/photo/my-images/407/reportzm.png/" rel="nofollow">http://imageshack.us/photo/my-images/407/reportzm.png/</a></p>
  
  <p>i need all the records to be displayed the first time the form loads. so i will be needing Report2.rdlc for that which has no filters.</p>
  
  <p>When i have Report1.rdlc binded, this is what we see</p>
  
  <p><a href="http://imageshack.us/photo/my-images/255/er11.png/" rel="nofollow">http://imageshack.us/photo/my-images/255/er11.png/</a></p>
  
  <p>nothing is displayed <strong><em>except</em></strong> we enter some value in the textbox and click search, records will be loaded based on what we are searching for.</p>
  
  <p>here is the code.</p>
  
  <pre><code>Imports Microsoft.Reporting.WinForms
  
  Public Class Form1
  
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          'TODO: This line of code loads data into the 'houseDataSet.Table1' table. You can move, or remove it, as needed.
  
  
          Me.Table1TableAdapter.Fill(Me.houseDataSet.Table1)
  
          Me.ReportViewer1.RefreshReport()
      End Sub
  
      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          Dim a As New ReportParameter("ReportParameter1", TextBox1.Text)
          ReportViewer1.LocalReport.SetParameters(New ReportParameter() {a})
          ReportViewer1.RefreshReport()
      End Sub
  End Class
  </code></pre>