[Mono-bugs] [Bug 381118] New: SqlDataReader converts SqlServer2005 bigint value into Decimal instead of Int64

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 17 18:58:13 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=381118


           Summary: SqlDataReader converts SqlServer2005 bigint value into
                    Decimal instead of Int64
           Product: Mono: Runtime
           Version: 1.9.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jfrayne at blizzard.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following partial code snippet demonstrates the problem. The "DateModified"
value in the SQL database is a bigint. In .NET, sqlValue is an Int64, while in
Mono sqlValue is a Decimal:

System.Data.SqlClient.SqlDataReader rdr;
..
object sqlValue = rdr["DateModified"];
Console.WriteLine(sqlValue.GetType().ToString());
long ticks = (long)sqlValue;

This results in an invalid cast exception in my application under Mono, because
there is an assumption that sqlValue is an Int64. I have worked around the
problem, but it involves some extra type checking.


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


More information about the mono-bugs mailing list