A few things you need to sort out in your code. First of all, it's wide open for a SQL injection attack - take a look at query2, you should use parameters in place of searchBox.Text instead.
You also need to release some resources in there. You need to Dispose of the memory stream and bitmap at the least, as well as the SQLiteConnection. Wrap them in using statements, e.g.:
using (ms = new MemoryStream(data))
{
}