Public Class frmStates

  Dim states() As String = IO.File.ReadAllLines("USStates.txt")

  Private Sub btnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFind.Click
    Dim query = From line In states
                Let name = line.Split(","c)(0)
                Let abbreviation = line.Split(","c)(1)
                Where abbreviation = mtbAbbrev.Text.ToUpper
                Select name
    If query.Count = 1 Then
      txtName.Text = query.First
    Else
      Dim str As String = " is not a valid state abbreviation."
      MessageBox.Show(mtbAbbrev.Text & str, "Error")
      mtbAbbrev.Clear()
      mtbAbbrev.Focus()
    End If
  End Sub

End Class

