Results 1 to 3 of 3

Thread: Auto Refresh windows form

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    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..

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    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.

  3. #3
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    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:
    1. Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
    2.         Me.DataGrid1.DataSource = RefreshData()
    3.     End Sub
    4.  
    5.     Function RefreshData() As DataTable
    6.         Dim dt As New DataTable()
    7.         da.SelectCommand = New SqlCommand("select * from student", cn)
    8.         da.Fill(dt)
    9.         Return dt
    10.  
    11.     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
  •  



Click Here to Expand Forum to Full Width