private void submit_Click(object sender, EventArgs e)
        {
            string          constring   = "datasource=localhost;port=3306;username=root;password=4010;";
            string          Query       = "update sportsbuddydb.userdata set name='" + this.firstname.Text + "',lastname='" + this.lastname.Text + "',email='" + this.emailText.Text + "' where username='******';";
            MySqlConnection conDataBase = new MySqlConnection(constring);
            MySqlCommand    cmdDataBase = new MySqlCommand(Query, conDataBase);
            MySqlDataReader myReader;

            try
            {
                conDataBase.Open();
                myReader = cmdDataBase.ExecuteReader();
                MessageBox.Show("Profile is updated!");
                while (myReader.Read())
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            this.Hide();
            StaticProfilePage eprofile = new StaticProfilePage();

            eprofile.ShowDialog();
        }
Esempio n. 2
0
        private void profileview_Click(object sender, EventArgs e)
        {
            this.Hide();
            StaticProfilePage profile = new StaticProfilePage();

            profile.ShowDialog();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            StaticProfilePage eprofile = new StaticProfilePage();

            eprofile.ShowDialog();
        }