Do I need to do anything other than below to refresh a gridview? (Im talking about the TableAdapter.Fill, will this cause the grid to rebind to the data automatically or do I need to include that also? (It currenly appears to be working when the timer is up it does seem to freeze up the app for a few seconds as it downloads the huge dataset but because there is so much data and it maybe 5-10min between a change its kind of hard for me to see if a change happens.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick |
Dim Diff As TimeSpan = TargetTime.Subtract(Now) |
If Diff.Seconds = 0 And Diff.Minutes = 0 Then |
Label1.Text = "Data Refresh Now! Stand By!" |
Me.ExpediteTableAdapter.CommandTimeout = 0 |
Me.ExpediteTableAdapter.Fill(Me.MSQL_ERPLXFDataSet.Expedite) |
TargetTime = Now.AddMinutes(30) |
ElseIf Diff.Seconds < 0 And Diff.Minutes >= 0 Then |
Label1.Text = "-" & Format(Diff.Minutes, "#0") & ":" & Format(System.Math.Abs(Diff.Seconds), "00") |
Else |
Label1.Text = "Data Refresh In " & Format(Diff.Minutes, "#0") & ":" & Format(System.Math.Abs(Diff.Seconds), "00") |
End If |
End Sub |