private void button4_Click(object sender, EventArgs e) { int KisiID = (int)dataGridView1.SelectedRows[0].Cells[0].Value; DBIslemleri.Sil(KisiID); MessageBox.Show("Silindi!"); }
private void Form1_Load(object sender, EventArgs e) { DataSet ulkelerDS = DBIslemleri.UlkeleriCek(); comboBox1.DisplayMember = "UlkeAdi"; comboBox1.ValueMember = "UlkeID"; comboBox1.DataSource = ulkelerDS.Tables[0]; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { int ulkeID = (int)comboBox1.SelectedValue; DataSet sehirlerDS = DBIslemleri.SehirleriCek(ulkeID); comboBox2.DisplayMember = "Sehir"; comboBox2.ValueMember = "SehirID"; comboBox2.DataSource = sehirlerDS.Tables[0]; }
private void button3_Click(object sender, EventArgs e) { int kisiID = (int)dataGridView1.SelectedRows[0].Cells[0].Value; string yenia = textBox7.Text; string yenis = textBox8.Text; string yenit = textBox9.Text; string yeniadr = textBox6.Text; DBIslemleri.Duzenle(kisiID, yenia, yenis, yenit, yeniadr); MessageBox.Show("Güncellendi"); }
private void button1_Click(object sender, EventArgs e) { string adi = textBox1.Text; string soyadi = textBox2.Text; string telefon = textBox3.Text; int sehirID = (int)comboBox2.SelectedValue; string adres = textBox4.Text; DBIslemleri.Ekle(adi, soyadi, telefon, sehirID, adres); MessageBox.Show("Eklendi"); }
private void textBox5_TextChanged(object sender, EventArgs e) { DataSet sonuclar = DBIslemleri.Arama(textBox5.Text); dataGridView1.DataSource = sonuclar.Tables[0]; }