If you have copy-pasted the code, there is at least one error with quoting. It should be like this:
mycom = New SqlCommand("DELETE @PICTUREDATA From pic WHERE
(NAME = '" + ListBox1.SelectedItem + "')", Me.SqlConnection1
But you should really consider using the SqlCommand.Parameters collection to add your input data. Your code is open to SQL injection attacks.
Albin Sunnanbo
2010-08-29 05:02:28