private void BtnSil_Click(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("delete from Admin where YoneticiID=@p1", bgl.baglanti()); komut.Parameters.AddWithValue("@p1", TxtYoneticiID.Text); komut.ExecuteNonQuery(); bgl.baglanti().Close(); MessageBox.Show("Yönetici " + TxtYoneticiAd.Text + " silindi"); this.adminTableAdapter.Fill(this.yurtKayitDataSet8.Admin); TxtYoneticiID.Clear(); TxtYoneticiAd.Clear(); TxtYoneticiSifre.Clear(); }
private void BtnKaydet_Click(object sender, EventArgs e) { SqlCommand komut = new SqlCommand("insert into Admin (YoneticiAd, YoneticiSifre) values (@p1,@p2)", bgl.baglanti()); komut.Parameters.AddWithValue("@p1", TxtYoneticiAd.Text); komut.Parameters.AddWithValue("@p2", TxtYoneticiSifre.Text); komut.ExecuteNonQuery(); bgl.baglanti().Close(); MessageBox.Show("Yönetici " + TxtYoneticiAd.Text + " eklendi"); this.adminTableAdapter.Fill(this.yurtKayitDataSet8.Admin); TxtYoneticiAd.Clear(); TxtYoneticiSifre.Clear(); }