title: how to pass a datatable to a new form in windowsce
body: <p>I am trying to pass a datatable to a new form, but I am having null reference exception. I dont understand why. SQL is returning many rows and I am sure it is not empty. here is my code</p>
  
  <pre><code>System.Data.SqlServerCe.SqlCeDataAdapter dap = new System.Data.SqlServerCe.SqlCeDataAdapter(stringSql, conn);
  DataTable dt2 = new DataTable();
  dap.Fill(dt2);
  
  cariSelection f = new cariSelection(dt2);  // form
  f.ShowDialog();
  </code></pre>
  
  <p>What am I doing wrong? </p>
  
  <p>here is the form constructor.</p>
  
  <pre><code>public cariSelection(DataTable dt) {
      dataGrid1.DataSource = dt;   // I am getting the null reference exception here
  }
  </code></pre>