muthu
muthu

Reputation: 87

passing null to DBtype.binary

I am using sqlparameter to insert value in to the table through procedure i have a prameter in procedure of type image in c# i set the parameter type as DbType.Binary now i want to pass Null value to the parameter if i use DBNull.value, i get incompatible data type error

Upvotes: 0

Views: 2528

Answers (1)

IordanTanev
IordanTanev

Reputation: 6240

Try like this int the sp set parametar default value null like this @parametar Binary = NULL and then in the code test if the value is null and if it is null just don't pass parameter to the sp and it will take default value null.

Upvotes: 2

Related Questions