Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public NotInheritable Class METARTAF
- Inherits Page
- Dim dbpath As String
- Dim conn As SQLiteConnection
- Public Sub New()
- ' This call is required by the designer.
- InitializeComponent()
- 'Ubicación de la base de datos
- dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "airportsdb.sqlite3")
- 'Conexión a la base de datos
- conn = New SQLiteConnection(New WinRT.SQLitePlatformWinRT(), dbpath)
- End Sub
- Private Sub AutoSuggestBox_TextChanged(sender As AutoSuggestBox, args As AutoSuggestBoxTextChangedEventArgs)
- Dim result = conn.Query(Of airports)("select * from airports where name ").FirstOrDefault()
- If args.Reason = AutoSuggestionBoxTextChangeReason.UserInput Then
- If sender.Text.Length > 1 Then
- sender.ItemsSource = result
- End If
- Else
- sender.ItemsSource = "No results..."
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement