I am programming for a Windows Mobile 6.5 device.
I am using SQL Server Compact Edition, and am trying to write a byte stream to the database.
The column type is image
(which I understand can handle more than 8000 bytes), however I am getting the exception:
InvalidOperationException
@signature : Byte array truncation to a length of 8000.
Any idea why this is happening?
string sql = @"INSERT INTO E_CONS_SIGNATURE (CONS_NO, SIGNATURE, SIGNATURE_FORMAT, SIGNATURE_DATE)"
+ " VALUES(@consNo, @signature, @format, @date)";
SqlCeCommand cmd = new SqlCeCommand(sql, conn);
cmd.Parameters.AddWithValue("@consNo", txtConsignment.Text);
cmd.Parameters.AddWithValue("@signature", ms.ToArray());
cmd.Parameters.AddWithValue("@format", "BMP");
cmd.Parameters.AddWithValue("@date", new DateTime());
bool success = cmd.ExecuteNonQuery() > 0;
Storing on the file system is not an option at the moment.