Hello,
What you are trying to do is a little difficult because you have to convert a Bitmap to a byte array, in memory. Here, I have filled a dataTable from a database, where I have BLOB column.
Here is the code:
MySqlConnection connection = databaseConnection.Connection;
SceneMetaData metaData = metaDataList[0] as SceneMetaData;
Bitmap start = metaData.SnapshotStart;
byte [] bytes = BmpToBytes_MemStream(start);
String query = "INSERT INTO thumbnail VALUES(NULL,1,@First,@Middle,@End," +
"@FirstTime,@SecondTime,@ThirdTime)";
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = connection;
cmd.CommandText = query;
cmd.CommandTimeout = 10000;
cmd.Parameters.AddWithValue("@First",bytes);
cmd.Parameters.AddWithValue("@Middle", bytes);
cmd.Parameters.AddWithValue("@End", bytes);
cmd.Parameters.AddWithValue("@FirstTime", "000000");
cmd.Parameters.AddWithValue("@SecondTime", "000000");
cmd.Parameters.AddWithValue("@ThirdTime", "000000");
cmd.ExecuteNonQuery();
The problem was originally that being used was a BLOB which has a capacity of 64K, not enough for the images. If you change this to MEDIUMBLOB everything should work.
Good Luck!
Sean Colicchio
Server Engineer
Host My Site
http://www.hostmysite.com/?utm_source=bb