Ejemplo n.º 1
0
        private void CreateBttn_Click(object sender, EventArgs e)
        {
            try {
                InitValues();

                
            }
            catch(Exception exc)
            {
                MessageBox.Show("Registration of member has failed. Please check your inputs and try again.\n\nError Code: " + exc.Message);
                return;
            }
            Member lad = new Member(this);
            SqlCommand com = lad.AddToSQL();
            com.Connection = connection;
            try
            {


                connection.Open();
                com.ExecuteNonQuery();
                connection.Close();
            }
            catch(SqlException exc)
            {
                MessageBox.Show("Writing to database has failed. Please check your connection, then try again.\n\nError Code: " + exc.Message);
                return;
            }
            MessageBox.Show("Registration Successful.");
            parent.PullData();
            this.Close();
        }