示例#1
0
        internal void SignUpOps()
        {
            StartDB();

            SignUp SignUp = new SignUp();

            string sqlstmt = "INSERT INTO DMSuser (user_id, passwd) VALUES (@user_id, @passwd);";
            SqlConnection connection = new SqlConnection(connectionString);
            SqlCommand commmand = new SqlCommand(sqlstmt, connection);

            //parameterize user_id
            commmand.Parameters.Add("@user_id", SqlDbType.VarChar, 10);
            commmand.Parameters["@user_id"].Value = SignUp.txtUserID.Text;

            //parameterize passwd
            commmand.Parameters.Add("@passwd", SqlDbType.VarChar, 50);
            commmand.Parameters["@passwd"].Value = SignUp.txtPwd.Text;

            //db execution
            connection.Open();
            commmand.ExecuteNonQuery();
            connection.Close();
        }
示例#2
0
 private void UserCredentialsSignUp_Click(object sender, EventArgs e)
 {
     SignUp f = new SignUp();
     f.Show();
 }