sqlce - how to insert DBNnull into binary column via parameter list
The table was created using the following script:
Code:CREATE TABLE [USERS] (
[USER_PASSWORD] binary(100) NULL
);
The SqlCeCommand command text:
Code:INSERT INTO [USERS]
([PASSWORD])
VALUES
(@password);
Add the parameter:
Code:command.Parameters.Add("@password", SqlDbType.Binary).Value = DBNull.Value;
This code works. Once I executed the command and get the error "Value was either too large or too small for an unsigned byte."
I thought it might be this column even though I couldn't figure out anything else wrong. But later I found the error was caused by another column.