Databinding DateTime fields

Discussion in 'ASP .Net' started by Alejandro Penate-Diaz, Feb 18, 2005.

  1. Hi. I am binding a datagrid to a sql table that has a DateTime field, this
    DateTIme field only has information about date and not about time, but my
    datagrid shows date and time and the time is always 12:00:00 AM. How can I
    remove this wrong time from my datagrid?
    Thanks,
    Alejandro.
     
    Alejandro Penate-Diaz, Feb 18, 2005
    #1
    1. Advertising

  2. Within the column properties there is "Data Formatting Expression", try
    setting it so something like {0:d} or {0:dd/MM/yyyy}

    Hope this helps.
    Chris.

    "Alejandro Penate-Diaz" wrote:

    > Hi. I am binding a datagrid to a sql table that has a DateTime field, this
    > DateTIme field only has information about date and not about time, but my
    > datagrid shows date and time and the time is always 12:00:00 AM. How can I
    > remove this wrong time from my datagrid?
    > Thanks,
    > Alejandro.
    >
    >
    >
     
    =?Utf-8?B?Q2hyaXMgUG9kbW9yZQ==?=, Feb 18, 2005
    #2
    1. Advertising

  3. it worked. thanks!

    "Chris Podmore" <> wrote in message
    news:...
    > Within the column properties there is "Data Formatting Expression", try
    > setting it so something like {0:d} or {0:dd/MM/yyyy}
    >
    > Hope this helps.
    > Chris.
    >
    > "Alejandro Penate-Diaz" wrote:
    >
    >> Hi. I am binding a datagrid to a sql table that has a DateTime field,
    >> this
    >> DateTIme field only has information about date and not about time, but my
    >> datagrid shows date and time and the time is always 12:00:00 AM. How can
    >> I
    >> remove this wrong time from my datagrid?
    >> Thanks,
    >> Alejandro.
    >>
    >>
    >>
     
    Alejandro Penate-Diaz, Feb 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    743
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    580
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    417
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    363
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    788
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page