コード例 #1
0
        private void BtnSil_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("delete from Personel where PersonelID=@p1", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtPersonelID.Text);
            komut.ExecuteNonQuery();
            bgl.baglanti().Close();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel silindi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }
コード例 #2
0
        private void BtnGuncelle_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("update Personel set PersonelAdSoyad=@p1, PersonelDepartman=@p2 where PersonelID=@p3", bgl.baglanti());

            komut.Parameters.AddWithValue("@p3", TxtPersonelID.Text);
            komut.Parameters.AddWithValue("@p1", TxtPersonelAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtPersonelDepartman.Text);
            komut.ExecuteNonQuery();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel güncellendi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }
コード例 #3
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            SqlCommand komut = new SqlCommand("insert into Personel (PersonelAdSoyad,PersonelDepartman) values (@p1,@p2)", bgl.baglanti());

            komut.Parameters.AddWithValue("@p1", TxtPersonelAd.Text);
            komut.Parameters.AddWithValue("@p2", TxtPersonelDepartman.Text);
            komut.ExecuteNonQuery();
            bgl.baglanti().Close();
            MessageBox.Show(TxtPersonelAd.Text + " isimli personel " + TxtPersonelDepartman.Text + " olarak eklendi");
            this.personelTableAdapter.Fill(this.yurtKayitDataSet9.Personel);
            TxtPersonelID.Clear();
            TxtPersonelAd.Clear();
            TxtPersonelDepartman.Clear();
        }