I would like to store the data in the MySQL BLOB field. I am using the following code:
int length = (int)fs.Length;
buffer = new byte[length];
int count;
int sum = 0;
while ((count = fs.Read(buffer, sum, length - sum)) > 0)
sum += count;
prikaz.CommandText = "INSERT INTO attachments (ReferenceID,Filename,File) VALUES ( " + referenceID + " , test , " + buffer + " )";
prikaz.ExecuteNonQuery();
But in the database, the BLOB field has always 13B. Could you please advice? Thanks!