0

ı 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();

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by adem87
0

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?

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.