title: An exception of type 'System.NullReferenceException' occurred
body: <p>I am trying to load a <code>dataTable</code> with a <code>dataReader</code> but for this simple process i am getting following error:</p>
  
  <blockquote>
    <p>An exception of type 'System.NullReferenceException' occurred in
    project.dll but was not handled in user code. Additional information:
    Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>My Code:</p>
  
  <pre><code>while (dtaRdr.Read())
  {
     testVar = dtaRdr.GetValue(5).ToString(); //DataExists.
  }
  sqlTbl.Load(dtaRdr);
  </code></pre>