Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Time wrong in dataset from Access DB

Time wrong in dataset from Access DB

Scheduled Pinned Locked Moved Visual Basic
databasecsharpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    numbrel
    wrote on last edited by
    #1

    Using an Access 2000 database, one field is Time, the data type is Date/Time, and the format is Short Time (24 hour clock) Using VB.NET, in the dataset, the Time field shows "12/30/1899" for every record. There is also a Date field and that comes through fine. Any ideas? Thanks.

    C 1 Reply Last reply
    0
    • N numbrel

      Using an Access 2000 database, one field is Time, the data type is Date/Time, and the format is Short Time (24 hour clock) Using VB.NET, in the dataset, the Time field shows "12/30/1899" for every record. There is also a Date field and that comes through fine. Any ideas? Thanks.

      C Offline
      C Offline
      Charlie Williams
      wrote on last edited by
      #2

      numbrel wrote: in the dataset, the Time field shows "12/30/1899" for every record DateTime in Access is stored as a double (DBTYPE_DATE) with the whole number portion representing the number of days since 12/30/1899. If you're only storing the time, the whole number portion will always be zero. After the value is converted to System.DateTime, you can get a TimeSpan representing the time of day from the TimeOfDay property. In a DataGrid, you can apply a DataGridTableStyle with a DataGridTextBoxColumn with the Format property set to "t" or "T" to display only the time portion. Charlie if(!curlies){ return; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups