Link to home
Start Free TrialLog in
Avatar of Jerry_Pang
Jerry_Pang

asked on

How To: save Null values pass through storedproc parameters

Private Function InsertEvaluation( _
        ByVal prmCustomerID As String, _
        ByVal prmID As String, _
        Optional ByVal prmSatisfaction As String = "", _
        Optional ByVal prmWillingToPay As String = "" _
        ) As Boolean

  Dim cmd As OleDbCommand = New OleDbCommand(sp, dbConn.Conn)
            cmd.CommandType = CommandType.StoredProcedure

...
...
            Dim CID As OleDbParameter = New OleDbParameter("p_ID", OleDbType.VarWChar)
             CID.Value = prmCustomerID
            cmd.Parameters.Add(pID)
...
..
end function

if i use
Private Function InsertEvaluation( _
        ByVal prmCustomerID As String, _
        ByVal prmID As String, _
        Optional ByVal prmSatisfaction As object= DBNull.value, _
        Optional ByVal prmWillingToPay As object= DBNull.value _
        ) As Boolean

i get a message that i have to use a constant value.,
SOLUTION
Avatar of zulu_11
zulu_11

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial