MySql 8.4 Parameter with DbNull.Value problems
Posted by: Jefferson Manske
Date: June 28, 2024 02:21PM

We are experiencing issues across various tables, with different fields, where randomly the value 2024 is being recorded in the column when passing the parameter as shown below. This occurs only when the instruction "IIf(iAnyID2 = 0, DBNull.Value, iAnyID2)" is used, even though the value of the property iAnyID2 is zero by default and the value is not assigned anywhere.

myCmd.Parameters.AddWithValue("@AnyID2", IIf(iAnyID2 = 0, DBNull.Value, iAnyID2))


It does not always record the value 2024; sometimes it correctly records NULL.

Options: ReplyQuote


Subject
Written By
Posted
MySql 8.4 Parameter with DbNull.Value problems
June 28, 2024 02:21PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.