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
Loading
Sam HobbsPosted Feb 21, 2011, 2:35 PM
I don't think that is related to the original question though.
Chr leogPosted Feb 21, 2011, 3:55 AM
nice tutorial. I think I have to try it out soon ... but I resolved my problem in another way:
I overlooked that visual studio used a copy of the access database - a copy which is located in the project folder.
After I changed that into a link, to another access database outside the project folder, it works as I expected. Is there a difference between a local copy of an access file or linking an access file?
thanks for your reply Sam Hobbs!
Sam HobbsPosted Feb 20, 2011, 5:18 PM
If your form is bound to the data, then the form should be updated automatically. Try my Database Table Update in a DataGridView without Writing Code to at least see if the form gets updated after a delete the way you want when you use the code generated using my suggestion in that article.