Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
in my database date column shows only date like 26-02-2015 but when i bind my database to gridview it show 26-02-2015 00:00:00.I don't want that 00:00:00.
how to write sql query for that and bind to gridview.,so that only date will display.
Posted
Comments
[no name] 6-Mar-15 1:27am    
y are u posting the same question again? http://www.codeproject.com/Questions/883443/how-to-eliminate-time-from-date?arn=17

Please do not post the same question again.

Here your old post : how to eliminate time from date
 
Share this answer
 
Comments
Prasanth Radhakrishanan 6-Mar-15 3:39am    
Correct :)
[no name] 6-Mar-15 3:49am    
:)
SQL
select convert(nvarchar(10),getdate(),103)


or In your GridView BoundField set

C#
DataFormatString="{0:dd/MM/yyyy}"
 
Share this answer
 
v3
Comments
batman56 6-Mar-15 1:31am    
thank you
King Fisher 6-Mar-15 1:32am    
Welcome ;)

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