none
SqlParameter Bug RRS feed

  • Question

  • Can someone explain to me if the following is a bug in the System.Data.SqlClient.SqlParameter class?
    If so, is it known and being fixed?
    The following is from the immediate window. Notice how passing an Int32 value of 0 results in the creation of a parameter with a null value, unlike all the other numeric types. All the other types behave normally,

    ?new System.Data.SqlClient.SqlParameter("@p1", (Int16)0).Value
    0
    ?new System.Data.SqlClient.SqlParameter("@p1", (Int32)0).Value
    null
    ?new System.Data.SqlClient.SqlParameter("@p1", (Int64)0).Value
    0
    ?new System.Data.SqlClient.SqlParameter("@p1", (Single)0).Value
    0.0
    ?new System.Data.SqlClient.SqlParameter("@p1", (Double)0).Value
    0.0




    Cheers
    Simon
    Wednesday, November 21, 2007 12:49 AM

All replies

  • Hi,

    I've never run into this problem.  Is this only in the immediate window or also in your application?

    Charles
    Sunday, December 2, 2007 6:50 PM