title: DataRow Column Has Value When Read One Way, But Not When Read a Different Way
body: <p>I'm trying to read values from a DataSet in C#/ASP.NET returned from a stored procedure. Normally, the DefaultView from that DataSet is passed into a GridView in an ASP.NET page. in that event, a particular column I'm interested in has a value. However, if I try to read a DataRow and get the column value, it comes through as empty.</p>
  
  <p>For example, this will display a value:</p>
  
  <pre><code>DataSet ds = //////
  DataView dv = ds.Tables[0].DefaultView;
  grdQuotes.DataSource = dv;
  grdQuotes.DataBind();
  </code></pre>
  
  <p>This, however, gives me no value:</p>
  
  <pre><code>DataSet ds = //////
  foreach (DataRow row in ds.Tables[0].Rows) {
      String value1 = (String)row["DOReviewDate"];
      String value2 = ((Object)row["DOReviewDate"]).ToString();
      String value3 = row.Field&lt;String &gt;("DOReviewDate");
  }
  </code></pre>
  
  <p>All three variables end up empty.</p>
  
  <p>I'm pretty lost on where to go with this, as it's apparent that there's a value being pulled from the SQL database, otherwise it wouldn't display in the GridView table on the page. Also, I can get the rest of the column values in the row without problem. Interestingly enough, there is one other column exhibiting the same behavior.</p>
  
  <p><strong>-- EDIT --</strong></p>
  
  <p>Attempt to iterate through rows and columns to get data:</p>
  
  <pre><code>StringBuilder sb = new StringBuilder();
  foreach (DataRow row in ds.Tables[0].Rows)
  {
      StringBuilder r = new StringBuilder();
      foreach (DataColumn c in ds.Tables[0].Columns)
      {
          r.Append(String.Format("{0} | ", row[c]));
      }
      r.Append("END");
      sb.AppendLine(r.ToString());
  }
  </code></pre>