Jump to content

C# Access Veritabanında Güncelleme Sorunu


tello_14_bjk
 Share

Recommended Posts

Arkadaşlar c# da bir program yapıyorum sıkıntım şimdi şu önceden kayıt yaptığımız veriyi güncellemek ama bir türlü olmuyor bütün veritabanını güncelliyor :( nasıl halledebilirim bu sorunu ? 

 

 

Güncelleme Butonu;

 

 baglanti.Open();
            DataTable dt = new DataTable();
            OleDbDataAdapter ad = new OleDbDataAdapter("UPDATE kayit SET WebSayfa='" + txtwebsayfa.Text + "',KullaniciAdi ='" + txtkullaniciadi.Text + "',Sifre='" + txtsifre.Text + "'", baglanti);
            ad.Fill(dt);
            dataGridView1.DataSource = dt;
            datagoster();
            baglanti.Close();
 
 
DataGridView deki bilgileri textbox'a aktarma
 
            txtwebsayfa.Text = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
            txtkullaniciadi.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
            txtsifre.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
 
Edited by tello_14_bjk
Link to comment
Share on other sites

SQL sorgusunun sonuna WHERE koymazsan tüm tabloyu günceller evet, bir tanımlayıcı gerekiyor.

"UPDATE kayit SET WebSayfa='" + txtwebsayfa.Text + "',KullaniciAdi ='" + txtkullaniciadi.Text + "',Sifre='" + txtsifre.Text + "' WHERE id='" + txtId + "'"

gibi...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...