CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  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

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Please Help! Update Problem

    You dont do data acces sthat way in vs 2005. Take a read of the DW2.0 link in my signature
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    Join Date
    Jun 2007
    Posts
    2

    Re: Please Help! Update Problem

    oh so much thanks!I've been finding an answer for three days.

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