Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i run the query

Select * from emp;

and display these information in a gridview it display time with the data of birth like 1988/2/3 12:00AM.
and when i run this query in database just date is display like 1988/2/3.
i just want to display the data in the gridview please help me to solve the problem...
Posted

use proper format string, for example if you use bound field
ASP.NET
<asp:BoundField DataField="YourDateField" HeaderText="SomeHeader" 
                    DataFormatString="{0:yyyy/MM/dd}"  />
 
Share this answer
 
v2
XML
<asp:Label ID="Label7" runat="server"
                                    Text='<%# Eval("columnname","{0:yyyy/MM/dd}") %>'></asp:Label>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900