Time wrong in dataset from Access DB
-
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.
-
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.
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 toSystem.DateTime
, you can get aTimeSpan
representing the time of day from theTimeOfDay
property. In aDataGrid
, you can apply aDataGridTableStyle
with aDataGridTextBoxColumn
with theFormat
property set to "t" or "T" to display only the time portion. Charlie if(!curlies){ return; }