Applying Format to a Dataset Column
<p>I have a <code>DataSet</code>, I am binding my <code>GridView</code> with this <code>DataSet</code>. My <code>AutoGenerateColumns</code> is set to true. One of the column that is returned by the <code>DataSet</code> has a <code>DateTime</code> value in it, I need only to get the date part of that and then bind the grid with the <code>DataSet</code>. I tried doing it this way, but that didn't work. Any help will be appreciated.</p>

<pre><code>  private void FormatDataSet(DataSet ds) 
{ 
    foreach(DataRow dr in ds.Tables[0].Rows.Count) 
       dr["Col5"] = (DateTime.Parse(dr["col5"].ToString())).ToString("d").ToString(); 
 }
</code></pre>
