Click to See Complete Forum and Search --> : Please Help! Update Problem


dreamade
June 25th, 2007, 12:39 PM
I have got a problem when i delete a row.Also it has started with VS.NET 2005.I hadnt experienced it before.It's about update. The warning is "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." i wrote the code here :

there's no problem when adding a row

private void button1_Click(object sender, System.EventArgs e)
{// inserting a row

DataRow addd=dataset11.Tables["adress"].NewRow();

ekle["nameSurname"]=textBox1.Text;

ekle["tel"]=textBox2.Text;

ekle["city"]=textBox3.Text;

ekle["adress"]=textBox4.Text;

ekle["EMAIL"]=textBox5.Text;

ekle["job"]=textBox6.Text;

dataset11.Tables["adress"].Rows.Add(addd);

oleDbDataAdapter1.Update(dataset11,"adress");

}
the problem is deleting a row

private void button3_Click(object sender, System.EventArgs e)

{

CurrencyManager asdf= (CurrencyManager)this.BindingContext[dataView1];

asdf.RemoveAt(asdf.Position);


oleDbDataAdapter1.Update(dataset11,"adress");

}


please helpp

cjard
June 26th, 2007, 05:43 PM
You dont do data acces sthat way in vs 2005. Take a read of the DW2.0 link in my signature

dreamade
June 27th, 2007, 04:57 PM
oh so much thanks!I've been finding an answer for three days.