formatting a sql datetime field

Hi: I have a datetime field that I'm pulling from a sql db into a formView. So in the formView I have:

<asp:TextBox ID="date_createdTextBox" runat="server" cssClass="formField"

Text='<% # Bind("date_created") %>' />

 If I want to just display the date, instead of the full date and time, is it better to convert it in the SQL query or in the formView itself? (and how would I convert it in the formview?)

0
dotnetnoob
3/13/2008 7:00:39 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
436 Views

Similar Articles

[PageSpeed] 7

 You can use Text='<%# Bind("[date_created]","{0:d}") %>'  in the above definition or you can get it from database directly (using DATEPART).

My choice will be to do it at the db end. 


Thanks
Gavini
0
gavini
3/13/2008 7:27:20 PM
Reply: