Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a form with gridview data with database data. With query I run INSERT INTO from one table into another, with button. I would like when I run procedure, also reset/update/refresh gridview with new import data.

For info, I have try with some methods, such as me.gridview.refresh() or update(), but nothing. Maybe I have also using this methods wrong.

VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim TEST = New WindowsApplication1.IdisDataSetTableAdapters.QueriesTableAdapter
        TEST.InsertQuery()
        
End Sub


[Moved answer of OP to question]

Found solution. I have call again Fill... :-)
VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TEST = New WindowsApplication1.IdisDataSetTableAdapters.Queri esTableAdapter
TEST.InsertQuery()
Me.IdisTableAdapter.Fill(Me.IdisDataSet.Idis)
End Sub


Thank you in advance for help to anyone!
Posted
Updated 4-Jan-11 5:46am
v6

If you bind your gridview to a BindingSource[^] and your DataSource to the BindingSource, you might be able to use the BindingSource.ResetBindings or ResetcurrentItem or ResetItem methods, although the BindingSource should do this automatically.
 
Share this answer
 
I think you'll have to rebind the datasource to the GridView. I can't locate any gridview related code in your event handler though.

Best Regards,
Manfred
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900