Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27233

VS 2010 DataGridView update problems

$
0
0
Hi,

I'm working on a project that uses DataGridViews.

Currently i have a form with a DataGridView present in it.
This DataGridView is linked to a dataset witch is linked to an SQL database.

From a second form I insert data into the SQL database using SQL-Querrys

After the data has been inserted the DataGridView needs to be updated.

I do this using the following sub that is located in the DataGridView is located.

Code:

Public Sub UpdateChauffeurs()
        Me.ChauffeursTableAdapter.Fill(Me.CdChauffeurs.Chauffeurs)
        ChauffeursDataGridView.EndEdit()
        ChauffeursDataGridView.Refresh()
    End Sub

Now when i call this sub with a button from the same form as the DataGridView, it updates perfectly.

However if i try calling this sub from an other form it dous not update.
This is how i currently call the sub from the second form:
Code:

frmChauffeurs.UpdateChauffeurs()
If anyone knows why this is not working let me know please :)

Viewing all articles
Browse latest Browse all 27233

Trending Articles