INSERT INTO `mytable` (`mycolumn1`, `mycolumn2`)
VALUES ('myValue1', @objectData);
_conn = new MySqlConnection(); _conn.ConnectionString = "MyConnectionString";
// You must open the connection before Prepare()
_conn.Open(); MySqlCommand nonQueryCommand = new MySqlCommand(query, _conn); nonQueryCommand.Prepare();
// Add parameter. myObjectData is my BLOB from C# nonQueryCommand.Parameters.AddWithValue("@objectData", myObjectData); nonQueryCommand.ExecuteNonQuery(); _conn.Close();
No comments:
Post a Comment