title: Unable to cast object of type 'System.DBNull' to type 'System.String'
body: <p>I have a datable code to generate a string, which is sb.ToString().</p>
  
  <pre><code>DataTable dt = dbaccess.GetDataTable("TEST"); // get datatable
  List&lt;DataRow&gt; drlist = dt.AsEnumerable().ToList(); // each row only has one element.
  StringBuilder sb = new StringBuilder(); 
  foreach (DataRow row in drlist)
  {
      foreach (string str in row.ItemArray)
      {
          sb.Append(str);
      }
  }
  </code></pre>
  
  <p>The datatable is </p>
  
  <pre><code>NULL
  0
  138
  337
  1666
  1680
  2511
  8113
  </code></pre>
  
  <p>You see that there is "NULL" to cause the error "Unable to cast object of type 'System.DBNull' to type 'System.String'. 
  How to fix it?</p>