79353163

Date: 2025-01-13 18:48:04
Score: 1.5
Natty:
Report link

insertCMD.Parameters.AddWithValue("@ErrorScreenshot", SqlDbType.VarBinary).Value = DBNull.Value;

when I had that error, I was able to trace it to my table structure where I had defined different data types for nvarchar and varbinary for a common columns say 'X' in two tables.

here's my solution I used in the stored procedure where these tables were being referenced:

insert into tablename (X,Y,Z) values (convert(varbinary,@X),@Y,@Z)

let me know if this works

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Chima Israel