FORM APP (C#) > DELETE PROBLEM SQL-!DATABASE

May 8 2015 6:45 PM
Please check to the code block!

I would delete selected rows on gridview. But 
i also would like to delete this selected rows which i choice on gridview IS also delete from database. but it doesnt work! HELP ME ! WHERE I MAKE MISTAKE !

 private void button3_Delete(object sender, EventArgs e)
        {
            con.Open();


            SqlCommand komut = new SqlCommand("delete from ME where pid = pid", con);




            int row = Convert.ToInt32(dataGridView1.Rows[0].Selected);
            if (row != 0)
            {
                dataGridView1.Rows.RemoveAt(row);


            }
           
            komut.ExecuteNonQuery();


            con.Close();


           
        }

Answers (2)