views:

264

answers:

1

hi 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

+1  A: 

Hi, 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 parameatr to the sp an ti will take default value null Best Regards, Iordan

IordanTanev