Hi everyone.. may i know any idea on doin auto refresh windows form to retrieve e latest update data from my database or a simple refresh function ? As i tried using timer b4.. it crashes when other forms is open.. thanks..
Printable View
Hi everyone.. may i know any idea on doin auto refresh windows form to retrieve e latest update data from my database or a simple refresh function ? As i tried using timer b4.. it crashes when other forms is open.. thanks..
Sorry, Wad i mean is how to do a auto refresh function or simple refresh function for my windows form. As i need to retrieve e latest data from e database for my windows form.
as i what i have understand to your problem here is some of my suggestion, you can do that in the form once activated, call the function that generates the data from the database.
cheers. :afrog:VB Code:
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated Me.DataGrid1.DataSource = RefreshData() End Sub Function RefreshData() As DataTable Dim dt As New DataTable() da.SelectCommand = New SqlCommand("select * from student", cn) da.Fill(dt) Return dt End Function