Chr leog

Chr leog

  • NA
  • 17
  • 14.4k

How to update a dataset

Feb 19 2011 3:09 PM
Hello everybody,

i have a dataset (the database is an ms access accdb-file). I only want to view the data over a data grid view element and that is still working.
The problem: Some people can change the access file (insert a new row) and I want to load the new data into my grid view. I created a button and I tried to programme this, but it doesn't work. Here is what I've tried:

        private void loadNewData(object sender, EventArgs e)
        {
            testDataSet.GetChanges();

            this.offeneTicketsTableAdapter.Fill(this.testDataSet.OffeneTickets);
            this.offeneTicketsDataGridView.Refresh();       
        }

With this code above, I won't show me the new data. If i stop my application and run it again, I am able to view the new data. But I don't want to restart my programme each time, I am expecting new data.

So please help me!


Thanks

Answers (3)