Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Public NotInheritable Class METARTAF
  2. Inherits Page
  3. Dim dbpath As String
  4. Dim conn As SQLiteConnection
  5.  
  6. Public Sub New()
  7.  
  8. ' This call is required by the designer.
  9. InitializeComponent()
  10. 'Ubicación de la base de datos
  11. dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "airportsdb.sqlite3")
  12. 'Conexión a la base de datos
  13. conn = New SQLiteConnection(New WinRT.SQLitePlatformWinRT(), dbpath)
  14. End Sub
  15.  
  16. Private Sub AutoSuggestBox_TextChanged(sender As AutoSuggestBox, args As AutoSuggestBoxTextChangedEventArgs)
  17. Dim result = conn.Query(Of airports)("select * from airports where name ").FirstOrDefault()
  18. If args.Reason = AutoSuggestionBoxTextChangeReason.UserInput Then
  19. If sender.Text.Length > 1 Then
  20. sender.ItemsSource = result
  21. End If
  22. Else
  23. sender.ItemsSource = "No results..."
  24. End If
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement