Reload DataGridView Tables when changes occur

donotenter

Member
Joined
Jul 27, 2013
Messages
6
Programming Experience
Beginner
I made some changes in my MS Access Tables like deleting a row but my DataGridView tables didnt update.

I tried using:

DataGridView1.Refresh()

is has no effect

Ive been searching codes for this, but all i can get is refreshing database changes that has been made through datagridview.

Im using VisualStudio2012 and I didnt populated my datagridview programmatically I just used the DataGridView Task then choose my Data Source and so on.
I also tried refreshing my Data Connections manually in Server Explorer View but still no effect.

here are the only codes in my form.

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'FullNameDataSet.ContactNumber' table. You can move, or remove it, as needed.
Me.ContactNumberTableAdapter.Fill(Me.FullNameDataSet.ContactNumber)
'TODO: This line of code loads data into the 'FullNameDataSet.Course' table. You can move, or remove it, as needed.
Me.CourseTableAdapter.Fill(Me.FullNameDataSet.Course)
'TODO: This line of code loads data into the 'FullNameDataSet.FullNameTable' table. You can move, or remove it, as needed.
Me.FullNameTableTableAdapter.Fill(Me.FullNameDataSet.FullNameTable)

End Sub


Thanks in advance!
 
Are you saying that you opened Access itself and edited the data and then the next time you ran your app those changes weren't reflected? What was the path of the MDB/ACCDB file that you edited? Is that actually the same path as the MDB/ACCDB file in your Solution Explorer? Normally, you create an Access database in your Documents folder and then, when you add it to your project, it will copy it into your solution folder. That means that any schema or data changes must be made to the copy in the solution and not the original, which you should probably delete.
 
That exaclty what ive done. The ACCDB file that I opened and to some updates is also the path file in my Solution Explorer, but it didnt copying the original database it is stuck from the last time I connect it to my datagridview. In my form properties I also tried changing the Copy to Output Directoy to Copy always.
 
I think I figured out now my problem. While searching my files I accidentaly saw a ACCDB file in my projects folder. I have no idea that a ACCDB file (like a duplicate) will be saved inside the folder of my project if I use the Add DataSource Wizard in DataGridView. Hahaha! Im such a noob! And Im still using my ACCDB file saved outside my projects folder thats why I dont see changes I made. But still thanks for a quick response jmcilhinney you're really dependable!
 
So, as it turns out, the issue was exactly what I said it was and when you said that the paths of the files were the same you did so without actually looking to see if they were indeed the same. In future, if someone points out a possible cause then please actually check it out and don't just assume that you're doing the right thing because, if you were doing the right thing, there wouldn't be an issue in the first place.
 
Back
Top