help !!!! my database returs always old value's

hello , my name is jonathan maes , i am a student , for a work i make a invetary program in C# express edition , i work with - Acces database
- databindings
now what's my problem , well when i delete a record from my database en i restart my program , and i visualise the values he shows the value what i trough away ,

can somebody help me

my excusses
for my bad english


you can mail me to
  • maes.jonathan@gmail.com
  • maes_jonathan@hotmail.com



Answer this question

help !!!! my database returs always old value's

  • Brian Shepherd

    this is my code for deleting a value , with a button

    he deletes the value when i am in my program , but when i restart my program he returns the value in my program

    bijbestellenDataSet1.bijbestellen.Rows[m_rowPosition].Delete();
    bijbestellenDataSet1.GetChanges();
    bijbestellenDataSet1.AcceptChanges();

    try
    {
    this.Validate();
    this.bijbestellenBindingSource.EndEdit();
    bijbestellenTableAdapter1.Update(this.bijbestellenDataSet1.bijbestellen);
    }
    catch
    {
    MessageBox.Show("Het deleten is mislukt probeer het opnieuw");
    }
    this.ShowCurrentRecord();



  • schallm

    I would double check your TableAdapters DeleteCommand to make sure that it is correctly deleting the row you are trying to delete.

    Can you post your delete / select statements

  • sophia james

    I am not sure of the coding lang

    VB .NET

    last command after update would need to recall the data

    DataGrid1.DataBind() 'if you are using datagrid

    I hope this helps


  • Vidhan

    Please post your code showing how you are deleting a row. Without seeing what you are doing in code, one can only guess.

  • steve hallden

    After deleting a row, you must call Update() on your Adapter.

  • Youngy

    The deleted row never makes it to the tableadapter Update call because you call AcceptChanges(), which removes the Deleted row from the dataset before Update gets a chance to update the database.

    try it without these lines:
    bijbestellenDataSet1.GetChanges(); //removed
    bijbestellenDataSet1.AcceptChanges(); //removed


  • cincyreds

    thanks all to you it works , you all are the best

    i buy you all a drink when you are once in belgium



  • help !!!! my database returs always old value's