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.StoredProcedur e
...
...
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.,
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.StoredProcedur
...
...
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.