I have a web application which allows e-signature. When I get the signature, it is the exact size(mostly greater than 8000 bytes).But when it goes to the database, it gets truncated to 8000 bytes all the time. When I checked varbinary, it says 'Implicit conversion fails if the byte array is greater than 8,000 bytes. Explicitly set the object when working with byte arrays larger than 8,000 bytes.' How do I do that in the following scenario? I don't want to loose any bytes.
public DataSet InsertInformation(FormInformation info)
{
SqlCommand command = new SqlCommand("SPInsertSig");
command.Parameters.Add("@Signature", SqlDbType.VarBinary).Value = info.Signature;
DataSet resultDataSet;
resultDataSet = ExecuteStoreProcedure(command);
return resultDataSet;
}
When I googled, someone mentioned trying this way but it doesn't work either and truncates the value to 8000 bytes.
SqlParameter param = command.Parameters.Add("@Signature", SqlDbType.VarBinary);
param.Value = info.Signature;
param.Size = -1;
Any suggestions will be really appreciated. Thanks
Update After changing it to Int32.MaxValue, it worked.