CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jun 2007
    Posts
    2

    Unhappy Please Help! Update Problem

    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
    Last edited by dreamade; June 25th, 2007 at 12:43 PM. Reason: additional information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured