private void button2_Click(object sender, EventArgs e) { Form13 f = new Form13(); this.Hide(); f.Show(); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Form13 f = new Form13(); this.Hide(); f.Show(); }
private void button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conn); con.Open(); int id = int.Parse(dgAttendanceInfo.Rows[row].Cells[0].Value.ToString()); SqlCommand command = new SqlCommand("delete from StudentAttendance where StudentId = '" + id + "'", con); command.ExecuteNonQuery(); MessageBox.Show("Deleted sucesfully!"); this.Hide(); Form13 frm = new Form13(); frm.Show(); }
private void btnAdd_Click(object sender, EventArgs e) { if (checkBox1.Checked == true) { status = "1"; } else if (checkBox2.Checked == true) { status = "2"; } else if (checkBox3.Checked == true) { status = "3"; } else { status = "4"; } SqlConnection con = new SqlConnection(conn); con.Open(); string id = "Select * from student where RegistrationNumber='" + cmbRegNo.Text.ToString() + "'"; SqlCommand cmd = new SqlCommand(id, con); var r = cmd.ExecuteReader(); r.Read(); int idno = r.GetInt32(0); SqlConnection connection = new SqlConnection(conn); SqlCommand exe = new SqlCommand("Update StudentAttendance set AttendanceStatus= '" + status + "' where StudentId='" + idno + "' and attendanceId='" + ID + "' ", connection); connection.Open(); exe.CommandType = CommandType.Text; exe.ExecuteNonQuery(); MessageBox.Show("UPdated Successfully!!"); Form13 f = new Form13(); this.Hide(); f.Show(); }