How to pass null value to database field having type of image. I am trying this but getting an error:
if (photo)
cmd.Parameters.AddWithValue("EPhotograph",img);
else
cmd.Parameters.AddWithValue("EPhotograph", "");
if (signn)
cmd.Parameters.AddWithValue("ESignature",sign);
else
cmd.Parameters.AddWithValue("ESignature",DBNull.Value);
Instead of
DBNull.Valueplease try to put empty byte array like thisnew byte[0];Reason SQL image type requires byte array as value in them.