ı want to update datagritview in c# . ı need to this codes.firt ı use edit and ı will edit after the termineting ı click save how can ı write ı use the access database
my last codes but can not work

urun = comboBox1.Text;
boyut = comboBox1.Text;
model = model1.Text;
sayi = sayi1.Text;
aciklama = aciklama1.Text;

baglan.Open();

veri = new OleDbCommand("UPDATE stok set urun='" + urun + "',model='" + model + "',sayi='" + sayi + "',boyut='" + boyut + "',aciklama='" + aciklama + "' where no= " + no + ";", baglan);


veri.ExecuteNonQuery();

baglan.Close();

Recommended Answers

All 2 Replies

Hi,
you want to update what? Database or datagridview?
This code looks like more to be use to update database, just that UPDATE statement isnt sufficient enough).
Is has to be like: "UPDATE TableName SET Field1 = @field1, Field2 = @field2 WHERE ColditionColumn = @field3"

Am I right?

ok but ı coudnt undertand clearly can you write for all of codes please

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.