Пример #1
0
        private void continueButton_Click(object sender, EventArgs e)
        {
            String        connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C: \Users\natha\Documents\Visual Studio 2015\Projects\AgileDevelopmentToolsSuite\AgileDevelopmentToolsSuite\ADTSDatabase.mdf';Integrated Security=True";
            SqlConnection conn             = new SqlConnection(connectionString);

            String     insertLoginQuery = "INSERT INTO @database (@UsernameField, @PasswordField) VALUES (@Username, @Password)";
            SqlCommand command          = new SqlCommand(insertLoginQuery, conn);

            command.Parameters.AddWithValue("@database", "dbo.Login");
            command.Parameters.AddWithValue("@UsernameField", "Username");
            command.Parameters.AddWithValue("@PasswordField", "Password");
            command.Parameters.AddWithValue("@Username", usernameBox.Text);
            command.Parameters.AddWithValue("@Password", passwordBox.Text);

            if (yesProfileButton.Checked == true)
            {
                try
                {
                    conn.Open();
                    command.ExecuteNonQuery();

                    this.Hide();
                    SkillSetForm skillSetForm = new SkillSetForm();
                    skillSetForm.Show();
                }
                catch
                {
                }
            }
            else
            {
            }
        }
 private void continueButton_Click(object sender, EventArgs e)
 {
     if (yesProfileButton.Checked == true)
     {
         this.Hide();
         SkillSetForm skillSetForm = new SkillSetForm();
         skillSetForm.Show();
     }
     else
     {
     }
 }