[Mono-bugs] [Bug 364426] New: ODBC: TIME columns are returned with column DataType set to System. DateTime instead of System.TimeSpan

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 24 10:44:00 EST 2008


           Summary: ODBC: TIME columns are returned with column DataType set
                    to System.DateTime instead of System.TimeSpan
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: i686
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
        ReportedBy: mjscod at gmx.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer

When you make an ODBC query on a table that would return values from a TIME
column, the IDataReader returns the DataType "System.DateTime" instead of
"System.TimeSpan" which is annoying because .ToString() adds returns a date


1. Create a table with one column ("column1 TIME")
2. Insert a row into this table with "column1"='11:12:13'
3. Read it using System.Data.Odbc using the IDataReader

IDataReader reader = ...;
Type t = reader.GetFieldType(0);

At this point t==typeof(DateTime) but it should be t==typeof(TimeSpan).

This is a problem because you cannot use the returned value as the input for a
new insert using parameters because you'd get a useless value/string (because
of the additional date).


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list