none
Table adapter RRS feed

  • Question

  • Hello everyone,

     

    i was working on my project that's early finished,

    but i'm having just a few problems.

    when i use this code to update the data in my data base

     

    private void saveToolStripMenuItem_Click(object sender, EventArgs e)

    {

    this.beheerTableAdapter.Update(this.beheerDataSet.beheer);

    MessageBox.Show("Update successful");

    }

     

    the message box showed up and tell me "update succesful"

    and when i click ok,

    the name, adres or others are changed..

    But when i close the form and come back again,

    the data in the database in stil the same!

    What's wrong?

    Greetz Rick

    Monday, June 18, 2007 10:42 PM

All replies

  • There are a number of causes that might produce these results, for example setting Visual Studio to copy the database to the output folder. You can find more information about common causes for this at the FAQ entry on http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=427451&SiteID=1.

     

    Tuesday, June 19, 2007 12:39 AM
  • one litle noob question:

    how to intergrate this: AcceptChanges();

    to:

    private void saveToolStripMenuItem_Click(object sender, EventArgs e)

    The code say it have to look like this

    private void AcceptChanges saveToolStripMenuItem_Click(object sender, EventArgs e)

    but now i have an output error.

    Help me!

    Tuesday, June 19, 2007 10:24 AM
  • If you are using a DataAdapter to update the database with the changes in your DataSet, you don't need to call AcceptChanges - the DataAdapter.Update method will do that for you when it's done (see the last step in the "order of execution" list on http://msdn2.microsoft.com/en-us/library/at8a576f.aspx).

     

    Tuesday, June 19, 2007 5:06 PM