title: Automatically refresh
body: <p>I want to ask how to auto refresh/update the listview using timer in vb.net.. Give me an idea or steps, or code. Here's my code in timer:</p>
  
  <pre><code>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      conn.Open()
      Timer1.enabled = False
      Timer1.interval = 5000
      Dim strquery As String = "Select * " &amp; _
                             "from software "
  
      Dim myCommand As New OdbcCommand(strquery, conn)
      Dim myReader As OdbcDataReader
      myReader = myCommand.ExecuteReader
      ListView1.Items.Clear()
      If myReader.HasRows = True Then
          'ListView1.BeginUpdate()
          While myReader.Read
              Dim ListView As ListViewItem
              ListView = ListView1.Items.Add(myReader("log_type").ToString())
              ListView.SubItems.Add(myReader("log_desc").ToString())
              ListView.SubItems.Add(myReader("log_details").ToString())
              ListView.SubItems.Add(myReader("log_date").ToString())
              ListView.SubItems.Add(myReader("software_desc").ToString())
              ListView.SubItems.Add(myReader("software_name").ToString())
              ListView.SubItems.Add(myReader("develop_date").ToString())
              ListView.SubItems.Add(myReader("last_update").ToString())
          End While
  
  End Sub
  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
      Timer1.Interval = 1000
      Timer1.Enabled = False
      ListView1.Refresh()
      ListView1.Items.Add(DateTime.Now.ToLongTimeString() + "," + _
                         DateTime.Now.ToLongDateString())
  End Sub
  </code></pre>
  
  <p>This timer doesnt work. Is there anything way to auto update or auto refresh a listview?.</p>