private void Button_Click_2(object sender, RoutedEventArgs e) { try { var db = new SQLite.SQLiteConnection(App.DBPath); string a; a = TextBox1.Text.ToString(); var emptab = (db.Table <lawyer>().Where(em => em.username == a)).Single(); if (emptab.username == a) { if (TextBox1.Text != "") { passvalue pv = new passvalue() { lawyername = TextBox1.Text, username = username.Text }; this.Frame.Navigate(typeof(Lawyer_info), pv); } else { tbl.Text = ""; tbl2.Text = "Match Not Found"; } } } catch (Exception ex) { tbl.Text = "Insert Name here"; } }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected async override void OnNavigatedTo(NavigationEventArgs e) { passvalue pv = (passvalue)e.Parameter; tbl3.Text = pv.lawyername; tbl.Text = pv.username; string a = tbl3.Text; var db = new SQLite.SQLiteConnection(App.DBPath); var emptab = (db.Table <lawyer>().Where(em => em.username == a)).Single(); try { StorageFile rfile = await ApplicationData.Current.LocalFolder.GetFileAsync(emptab.username + ".jpg"); using (IRandomAccessStream fileStream = await rfile.OpenAsync(Windows.Storage.FileAccessMode.Read)) { // Set the image source to the selected bitmap BitmapImage bitmapImage = new BitmapImage(); await bitmapImage.SetSourceAsync(fileStream); Show_image.Source = bitmapImage; } } catch (Exception ex) { var var_name = new MessageDialog("Unable to load pic"); var_name.Commands.Add(new UICommand("OK")); var_name.ShowAsync(); } //string s1 = "ms:appx///" + emptab.image; //string s1 = emptab.image; tbl2.Text = emptab.working_field; tbl5.Text = emptab.exp; tbl7.Text = emptab.about; tbl8.Text = emptab.contactno; tbl9.Text = emptab.email; tbl10.Text = emptab.location; //Show_image.Source = new BitmapImage(new Uri(s1, UriKind.RelativeOrAbsolute)); //BitmapImage image = new BitmapImage(); //image.SetSource(s1); //txtImg1.Text = emptab.image.ToString(); //StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(("ms-appx:///" + emptab.image),UriKind.RelativeOrAbsolute)); //using (IRandomAccessStream filestream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read)) //{ // BitmapImage image = new BitmapImage(); // image.SetSource(filestream); // Show_image.Source = image; //} }