title: asp.net formatting dateTime in gridview
body: <p>I'm binding a gridview dynamically from a table in my database I have called "Sessions".  I get the information from a method using a linq query that is something like this:</p>
  
  <pre><code>var s = from sessions in datacontext.Sessions
                      where sessions.test == id
                      orderby sessions.ID ascending
                      select sessions;
  gridView.DataSource = qsessions;
  gridView.DataBind();
  </code></pre>
  
  <p>Sessions contains a dateTime field that I want to minimize to just display the date (month/day/year).  From what I've read through google searches, the solution is to specify the formatting in the aspx markup of the gridview using something like:</p>
  
  <pre><code>&lt;asp:TextBox ID="txtDate" runat="server" Text='&lt;%# Eval("dateTime", "{0:MM/dd/yyyy}") %&gt;'&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>It doesn't seem to work and still shows the time after the date.  Is there something I'm missing?  Help much appreciated!  </p>