Click here to Skip to main content
15,665,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am working with windows phone app 8.1. Created a registration page and login page. Inserted values successfully from registration page. the columns of table are listed below

public class Mytable
            public string Name { get; set; }
            public string Password { get; set; }
            public string Gender { get; set; }
            public string State { get; set; }

How to compare them to login successfully to the next page. Please modify the below code so that the login should be successful.

private async void Button_Click_1(object sender, RoutedEventArgs e)
            var dbpath = ApplicationData.Current.LocalFolder.Path + "/Mydb1.db";
            var con = new SQLiteAsyncConnection(dbpath);
            List<Mytable> mylist= await con.QueryAsync<Mytable>("select * from Mytable where Name='" + text_reg.Text + "' and Password='" + text_password.Password + "'");
            foreach(Mytable r in mylist)

                    if (r.Name == text_reg.Text && r.Password == text_password.Password)
                        var messagedialog = new MessageDialog("Successful").ShowAsync();
                        var messagedialog = new MessageDialog("successful").ShowAsync();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900