コード例 #1
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            SqlConnection connection = new SqlConnection(connectionString);

            connection.Open();

            SqlCommand command = new SqlCommand("StudentRegister", connection);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("Name", txtName.Text);

            command.Parameters.AddWithValue("Malayalam", txtMalayalam.Text);
            command.Parameters.AddWithValue("English", txtEnglish.Text);
            command.Parameters.AddWithValue("Maths", txtMaths.Text);

            command.Parameters.AddWithValue("Username", txtUser.Text);
            command.Parameters.AddWithValue("Password", txtPass.Text);

            command.ExecuteNonQuery();
            connection.Close();

            MessageBox.Show("Account Successfully created");
            StudentLogin obj = new StudentLogin();

            obj.Show();
            this.Hide();
            txtName.Text = txtUser.Text = txtPass.Text = txtEnglish.Text = txtMaths.Text = txtMalayalam.Text = "";
        }
コード例 #2
0
        private void btnLogOut_Click(object sender, EventArgs e)
        {
            StudentLogin obj = new StudentLogin();

            obj.Show();
            this.Close();
        }