Date only ,Gridview,C#

Posted by Raja_89 under C# on 3/12/2013 | Points: 10 | Views : 852 | Status : [Member] | Replies : 2
Hai Techie

I have placed a gridview with date values from Sql server
EX:01-01-2010 09.23:00

In that is it possible to show only date values
01-01-2010




Responses

Posted by: Jayakumars on: 3/12/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

check this code
Bind your Date Field like this


<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblDoj" runat ="server" Text ='<%# Bind("Doj","{0:M-dd-yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>


Mark as Answer if its helpful to you

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 3/12/2013 [Member] Starter | Points: 25

Up
0
Down
SELECT CONVERT(VARCHAR(10),'01-01-2010 09.23:00',110)

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response