Skip to main content

AccessTr.neT


C# ile mükerrer kayıt engelleme

C# ile mükerrer kayıt engelleme

Çözüldü #1
Kod:
      private void button1_Click(object sender, EventArgs e)
       {
           if ((textBox1.Text != "") && (textBox2.Text != "") && (textBox3.Text != ""))
           {
               baglanti.Open();
               string sorgu = "insert into ogrenciler(OkulNo,Ad,Soyad,Resim) values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + pictureBox1 .ImageLocation + "')";
               OleDbCommand komut = new OleDbCommand(sorgu, baglanti);
               komut.ExecuteNonQuery();                
               pictureBox1.Image.Save("Resimler/" + textBox1 .Text.ToString () + ".jpg");
               baglanti.Close();                
               TabloyuDoldur();
               MessageBox.Show("kayıt eklendi");                
           }
       }

Bu kod ile mükerrer kaydı nasıl engelleyebilirim?
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
C# ile mükerrer kayıt engelleme - Yazar: alican60 - 25/09/2015, 11:48
RE: C# ile mükerrer kayıt engelleme - Yazar: y2941 - 08/04/2023, 20:44
Task