CafeProject.frmProfil.profilDelete C# (CSharp) Метод

profilDelete() публичный Метод

public profilDelete ( int id ) : void
id int
Результат void
        public void profilDelete(int id)
        {
            int idd;
            SqlCommand com1 = new SqlCommand("select * from profil where adi='" + comboBox1.SelectedItem + "'", db.dbConnect());
            db.dbConnect();
            SqlDataReader dr = com1.ExecuteReader();
            while (dr.Read())
            {
                idd = Convert.ToInt32(dr["id"]);

                SqlCommand com = new SqlCommand("profilDelete", db.dbConnect());
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@id", SqlDbType.Int).Value = idd;
                db.dbConnect();
                com.ExecuteNonQuery();
                db.dbClose();
                MessageBox.Show("Profil başarıyla silindi.");

            }
            idTut();
        }