I my opinion, the problem arises when you try to use a byte array to fill a parameter without specifying the parameter type
because the default costructor may decide thet the longblob is equivalent to longtext and then translate to string.
please see this discussion about when to use the new AddWithValue or the old Add to explicily specify the SQL type of parameter.