title: RDLC- An Error occurred during local report processing. The report definition is not valid
body: <p>I have a report form "Form1ReportSale". On it's load event I want to generate RDLC report on the basis of an ID which comes from another form. When I put my program in debug mode, DataSet returns expected value but throws an error.</p>
  
  <p>Please find an attachment <a href="https://i.stack.imgur.com/q5jxJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q5jxJ.png" alt="Here is the error"></a> </p>
  
  <p>My "Form1ReortSale" load event code is following:</p>
  
  <pre><code>public partial class Form1ReportSale : Form
  {
      string CS;
      private string id;
      public string UserID
      {
          get { return id; }
          set { id = value; }
      }
      public Form1ReportSale()
      {
          InitializeComponent();
          CS = ConfigurationManager.ConnectionStrings["BikeDB"].ConnectionString;
      }
  
      private void Form1ReportSale_Load(object sender, EventArgs e)
      {
          this.WindowState = FormWindowState.Maximized;
          //DataSet1NewCustomerBike dsCustomers = GetData(id);
          reportViewer1.ProcessingMode = ProcessingMode.Local;
          reportViewer1.LocalReport.ReportPath = @"E:\Working Area\Directorate Of IT Project\Own Practices\BikeShowRoom\BikeShowRoom\Reports\Form1ReportSale.cs";
          DataSet ds = new DataSet();
          ds = getDataByID(Convert.ToInt32(id));
          ReportDataSource datasource = new ReportDataSource("DataSet1Customer",ds.Tables[0]);
          this.reportViewer1.LocalReport.DataSources.Clear();
          reportViewer1.LocalReport.DataSources.Add(datasource);
          reportViewer1.LocalReport.Refresh();
          reportViewer1.RefreshReport();
      }
  
      private DataSet getDataByID(int ID)
      {
          DataSet ds = new DataSet();
          using (SqlConnection con = new SqlConnection(CS))
          {
              SqlCommand cmd = new SqlCommand("SELECT * FROM AddNewBike WHERE ID = '"+ID+"'", con);
              SqlDataAdapter ad = new SqlDataAdapter(cmd);
              con.Open();
              ad.Fill(ds);
          }
          return ds;
      }
  }
  </code></pre>