Page 1 of 1

lost connection to MySql Server during query 2013 by using Blob fields

Posted: Wed 30 May 2007 23:24
by Marcel
Hi
I have probleme when i try to save Blob fields with the ExecuteNpnQuery Methode.

private void StoreBlob2DataBase_AsInsert(byte[] content)
{

mySqlConnection1.Open();

try
{
// insert new entry into table
MySqlCommand insert = new MySqlCommand("INSERT INTO item_picture (Picture) VALUES (@picture)", mySqlConnection1);
MySqlParameter imageParameter = insert.Parameters.Add("@picture", MySqlType.Blob);
//imageParameter.Value = content;
imageParameter.MySqlValue = content;
imageParameter.Size = content.Length;
//insert.CommandTimeout = 200;
insert.ExecuteNonQuery();
}
catch (MySqlException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n" +
"Error-Code " + myException.Code.ToString) + "\n");
}
finally
{
mySqlConnection1.Close();
}
}

MySQL Server 6.0
Table type InnoDB
MS Vista / VS2005
CoreLab 4.0

Can someone help???

Thanks
Marcel

Posted: Thu 31 May 2007 09:00
by Alexey
Have you looked at our "Pictures" demo project? It works fine with MySQL Server 6.0 alpha. What is the size of the BLOBs you are inserting? Doesn't increasing CommandTimeout help?

Posted: Thu 31 May 2007 12:19
by Marcel
I tryed different sizes of pictures (200K - 3MB), Always i got the same error messages. Increasing the commanttimeout.....no success.

Marcel

Posted: Fri 01 Jun 2007 09:00
by Alexey
Alexey wrote:Have you looked at our "Pictures" demo project? It works fine with MySQL Server 6.0 alpha. Doesn't increasing CommandTimeout help?