This statement is incorrect:
cmd.CommandText = "select picture from pictures where id ='" +
listBox1.Text.ToString() +
"'";
It should read:
cmd.CommandText = "select picture from pictures where id ='" +
listBox1.SelectedItem.Text +
"'";
Of course this assumes an item is selected in
listBox1
. Also, your code is guilty of SQL injection, but that's a whole different story.
/ravi