0

I am using VS 2010 with SQL Server 2008 R2 Express to develop an ASPX page

In my database there is a column of type Date.

I stored data in dd/mm/yyyy format. Didn't put any time there and it doesn't show any time when I view table data in SQL Server.

But in my aspx page, when I pull data using GridView and SqlDataSource...it shows dd/mm/yyyy hh:mm:ss AM/PM (example- 12/04/2012 12:00:00AM)

Why does it show the time? How can I remove that time part & show just the date ?

Please help

PS: I'm using .net Framework 4.0 and C#

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Sakir Khan
  • 15
  • 1
  • 5
  • The .NET framework doesn't have a `Date` datatype - it's always `DateTime`. But the .NET framework also has great support for specifying a **display format** in a grid to show only the date portion of the `DateTime`. – marc_s Sep 22 '13 at 10:55

1 Answers1

1

Take a look at that MSDN article. http://msdn.microsoft.com/en-us/library/az4se3k1.aspx You need to set up the DataFormatString string with one of the format strings from the link above :)

Mihail Shishkov
  • 14,129
  • 7
  • 48
  • 59