I have a column value in Hash format in db and column datatype is varbinary(8000).I convert it into byte array.
Problem is some time this column value has null value,now in my code I want to check if column value has null value then return default value of byte array,otherwise return column value using following code
objUser.Password_Hash = IIf(reader("Password_Hash") Is Nothing, {}, reader("Password_Hash"))
this gives error as below
System.InvalidCastException: Unable to cast object of type 'System.Byte' to type 'System.Byte[]'.