title: A data source instance has not been supplied for the data source 'DataSet2'-SSRS
body: <p>This is my First report using SSRS.</p>
  
  <p>I am trying to generate a Report using SSRS in asp.net.</p>
  
  <p>My Need is:</p>
  
  <p>I want to create a report with multiple tables (4 tables) that have relationship with one another. I have configured each individual table with accepting 1 parameter, for instance:
    <img src="https://i.stack.imgur.com/u39Rj.png" alt="enter image description here"></p>
  
  <p>What I tried is:</p>
  
  <p>I have created a dataset.xsd with 4 tables and given the relationship between those tables.
  Then I created a report.rdlc and designed a report with four tables and drag and dropped the required field to the table and created a report parameter called ID.</p>
  
  <p>The error i'm Getting is:</p>
  
  <p><code>A data source instance has not been supplied for the data source 'DataSet2'</code></p>
  
  <p><img src="https://i.stack.imgur.com/0mnWb.png" alt="enter image description here"></p>
  
  <p>What I have written in cs page on button click is:</p>
  
  <pre><code>protected void BtnGo_Click(object sender, EventArgs e)
          {
              DataSet2TableAdapters.TB_TransReceiptTableAdapter ta = new DataSet2TableAdapters.TB_TransReceiptTableAdapter();
              DataSet2.TB_TransReceiptDataTable dt = new DataSet2.TB_TransReceiptDataTable();
              ta.Fill(dt,Convert.ToInt16( TxtID.Text));
              //ta.Fill(dt,TxtID.Text);
              ReportDataSource rds = new ReportDataSource();
              rds.Name = "DataSet2";
              rds.Value = dt;
              ReportParameter rp = new ReportParameter("ID", TxtID.Text.ToString());
              rptviewer.LocalReport.DataSources.Clear();
              rptviewer.LocalReport.ReportPath = "Report1.rdlc";
              rptviewer.LocalReport.SetParameters(new ReportParameter[] { rp });
              rptviewer.LocalReport.DataSources.Add(rds);
              rptviewer.LocalReport.Refresh();
              rptviewer.Visible = true;
          }
  </code></pre>
  
  <p>The help i seek is:</p>
  
  <p>I dont know how to bind the report via code, since I have four tables that are related to one another with foreign key. Above is the code I used but it throws an error.</p>
  
  <p>I would be very thankful if some one could help me to solve this issue.</p>
  
  <p>Thanks in advance.</p>