none
Pass NULL to stored proc instead of an empty string ('') using typed data set and TableAdapter RRS feed

  • Question

  • I need to send  a NULL value as a parameter in the stored proc if the coresponding field in the data set does not contain a value (is null or empty).

     

    Settings in the data set designer for the field

     

    AllowDBNull = true

    DefaultValue = DBNull

    NullValue =(NULL)

     

    Whit these settings, sometimes NULL is sent, sometimes ''. ???

     

    Monday, October 1, 2007 1:19 PM

All replies

  • I believe setting only AllowDBNull property to True is enough to make column to store NULL value. You could also assign DBNull.Value (not just DBNull) to DefaultValue property

     

    Monday, October 1, 2007 10:35 PM
    Moderator