nullable sqlparameter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • buran

    #1

    nullable sqlparameter

    Dear ASP.NET Programmers,

    How can I make an sqlparamater accept NULL value programmaticall y? I use the
    following the code, but it does not work:

    Dim admDate As SqlParameter
    admDate = New SqlParameter("@ admissionDate", SqlDbType.Small DateTime)
    admDate.isNulla ble = True
    admDate.Value = CType(admission Date, Date).Date.ToSt ring("dd.MM.yyy y")

    The compliler throws an exception when passing System.DBNull value to the
    sqlparamater admDate.
    Thanks in advance,

    Buran


Working...