title: How to Pass data table from DataGridView to ReportViewer
body: <p>How to Pass data table from DataGridView ro ReportViewer ?</p>
  
  <p>in a win Form I have a DataGridView control that fills from a SqlDataAdapter , and I added a check box column to it. for "ready to print"(or smt like this)</p>
  
  <p><strong>now I want to create a report with ReportViewr to show only checked rows in my DataGridView.</strong></p>
  
  <p>here is codes of my form1 (Contains datagridview)</p>
  
  <pre><code>private void Fill_DGV_Sefaresh()
      {
          try
          {
              MyDB db = new MyDB();//class that contains my SQL Connection
              string sql = "SELECT sid, CONVERT(VARCHAR(10), cast(sdate as date), 111)sdate, sdes, sfor, suname, isdone, sqty FROM sefaresh order by sid desc";
              SqlDataAdapter sda = new SqlDataAdapter(sql,db.MyConn);
              DataSet ds = new DataSet();
              BindingSource bs = new BindingSource();
              sda.Fill(ds);
              bs.DataSource = ds.Tables[0].DefaultView;
              bindingNavigator1.BindingSource = bs;
              dataGridView1.DataSource = bs;
          }
              catch { }
  }
  </code></pre>
  
  <p>codes of my form2 (contains ReportViewer Control)</p>
  
  <pre><code>private SqlDataAdapter idata()
      {
          MyDB db = new MyDB();
              string sql = "SELECT * FROM sefaresh";
              SqlDataAdapter sda = new SqlDataAdapter(sql, db.MyConn);
              return sda;
          }
  private void SefareshView_Load(object sender, EventArgs e)
          {
              idata().Fill(this.DS_Sefaresh.sefaresh);//DS_Sefaresh is a dataset item , sefaresh is a Table adapter
              this.reportViewer1.RefreshReport();
          }
  </code></pre>