Date/Time in a DataGrid

This is a discussion on Date/Time in a DataGrid within the C# Programming forums, part of the General Programming Boards category; I have a DataGrid control in my form, and I'm trying to make it show date and time. It is ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    11

    Date/Time in a DataGrid

    I have a DataGrid control in my form, and I'm trying to make it show date and time. It is bind(ed?) to a dataset which contains a date/time column (which is filled with data from SQL database, by the way). But, my DataGrid only shows date in that column and not the time(I've tried changing width but that's not the problem). I tried editing DataGridColumnStyle class for that column but couldn't figure it out. I would also like that only hours and minutes are shown, not seconds.

    And I guess this question goes in this forum, too. It's basically a question about SQL syntax. How do I update a field in a column which has a multiple word name. E.g, column's name is "Number of elements":

    Code:
    UPDATE Table1 SET Number of elements=64 WHERE ID=13
    I tried putting it in qoutes but it didn't work. I know that the obvious solution is to simply change column's name, but I don't want to that, and, anyway, it works in Access, so why shouldn't it work with string commands?

    Thanks.
    Last edited by gargamel; 07-25-2005 at 01:14 PM.

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    11
    OK, I got it working now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DataGrid drag and drop
    By gtriarhos in forum C# Programming
    Replies: 0
    Last Post: 10-11-2005, 12:36 PM
  2. Selecting text in a DataGrid
    By BigDaddyDrew in forum C# Programming
    Replies: 1
    Last Post: 08-09-2004, 05:04 PM
  3. Datagrid Column Header
    By gvector1 in forum Windows Programming
    Replies: 0
    Last Post: 03-15-2004, 03:08 PM
  4. DataGrid or MS Flex grid, is there one in C++ ??
    By Digs in forum Windows Programming
    Replies: 1
    Last Post: 10-30-2003, 12:43 PM
  5. Datagrid Events
    By gvector1 in forum C# Programming
    Replies: 0
    Last Post: 10-01-2003, 09:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21