I have a datetime type field defined in DB. I select data in a store procedure and bind the selection in a grid. I don't want the timestamp displaying. For "2011-05-19 14:11:16.000", I only want to display "2011-05-19" or "05/19/2011" I tried Convert, substring, or define control width, none of them works. Please help.
The frid is defined as
<asp:GridView ID="kGridView" runat="server"
AllowSorting="True" AutoGenerateColumns="false"
OnDataBound="kGridView_DataBound"
OnSelectedIndexChanged="kGridView_IndexChanged">
<Columns>
<asp:CommandField HeaderText="Read" ShowSelectButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID #" />
<asp:BoundField DataField="Location" HeaderText="Location" />
... ...
<asp:BoundField DataField="DateOut" HeaderText="DateOut" />
<asp:BoundField DataField="DateIn" HeaderText="DateIn" />
</Columns>
<PagerStyle HorizontalAlign="Center" />
<AlternatingRowStyle BackColor="#F0F0F0" />
</asp:GridView>