Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Private Sub ShowLinkList() ' If no companies are defined, display a dummy element, otherwise display the real links ' ----- So, read the table of links which have been defined ---- ' Create a connection string Dim connString As String = "Provider=VFPOLEDB.1;" + _ "Data Source=" & MyDataPath & ";" Dim myConnection As OleDbConnection = New OleDbConnection Dim strSqlQuery As String myConnection.ConnectionString = connString ' Create a data adapter strSqlQuery = "SELECT * FROM TaInit WHERE s200name <> '' ORDER BY TempaidID" Dim da As OleDbDataAdapter = New OleDbDataAdapter(strSqlQuery, myConnection) ' Create a new dataset Dim ds As DataSet = New DataSet ' Fill dataset da.Fill(ds, "TaInit") '--- Display the three columns --- ' Can also change the width of the columns by changing the '100' to a different value. ' The alignment can also be changed, to be right or centre aligned. lvwCompanyLinks.Columns.Add("Co ID", 80, HorizontalAlignment.Left) lvwCompanyLinks.Columns.Add("Company Name", 150, HorizontalAlignment.Left) lvwCompanyLinks.Columns.Add("Target Company", 220, HorizontalAlignment.Left) lvwCompanyLinks.MultiSelect = False '--- Populate the rows ----- ' Define variable to hold the ListItem information ' so that we can add values to the column we want to change Dim lSingleItem As ListViewItem ' Check if any links have been defined With ds.Tables(0) If .Rows.Count = 0 Then ' Indicate that we have NO links bLinksDefined = False ' Create dummy link as no links are defined lSingleItem = lvwCompanyLinks.Items.Add("TBA") ' Create a new line, and assign the ListItem into the variable so we can add sub items lSingleItem.SubItems.Add("TBA") ' The first sub item for the first line lSingleItem.SubItems.Add("TBA") ' The second sub item for the first line Else ' Indicate that we DO have links bLinksDefined = True Dim i As Integer ' Row counter For i = 0 To .Rows.Count - 1 ' Display the list of real links lSingleItem = lvwCompanyLinks.Items.Add(.Rows(i).Item("TempaidID")) 'Create a new line, and assign the ListItem into the variable so we can add sub items 'The first sub item for the line lSingleItem.SubItems.Add(.Rows(i).Item("TaName")) 'The second sub item for the line lSingleItem.SubItems.Add(.Rows(i).Item("S200Name")) Next End If End With ' No item is selected. Check if there is a row to select! lvwCompanyLinks.Items(0).Selected = True lvwCompanyLinks.Items(0).Focused = True lvwCompanyLinks.Focus() End Sub Private Sub lvwCompanyLinks_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvwCompanyLinks.SelectedIndexChanged ' NOTE To show that a row is selected, even when the control does not have focus, ' set HideSelection = False, and FullRowSelect = True. ' Check if a row is selected If lvwCompanyLinks.SelectedIndices.Count = 0 Then Exit Sub Dim lvi As ListViewItem = lvwCompanyLinks.SelectedItems(0) MessageBox.Show(lvi.Text & " / " & lvi.SubItems(1).Text & " has been selected.") End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.