it is in your code
Code:
DELETE FROM product WHERE p_code = '" & listgrid.SelectedRows(0).Selected & "'", conn1)
                d = cmd1.ExecuteReader
after loading your data in to the datagridview
(1) you need to give a specific way to the user to select the row or rows
(2) one way of doing it is providing the check box columns in the grid
(3) and if the user selects any such row ( i mean if selected is true) then that row should be deleted from the database + from grid as well

so how you are populating your grid