|
-
Apr 14th, 2005, 08:53 AM
#1
Thread Starter
New Member
Auto Refresh windows form
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..
-
Apr 14th, 2005, 09:44 AM
#2
Thread Starter
New Member
Re: Auto Refresh windows form
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.
-
Apr 14th, 2005, 09:35 PM
#3
Hyperactive Member
Re: Auto Refresh 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.
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
cheers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|