private void btnSave_Click(object sender, EventArgs e)
{
Koneksi();
cmd = new SqlCommand($"insert into Student values ('{txtName.Text}','{txtSex.Text}','{txtClassLevel.Text}','{txtAddress.Text}','{txtEmail.Text}','{txtPhone.Text}','{txtReligion.Text}','{txtParentName.Text}','{txtStatus.Text}')", con);
cmd.ExecuteNonQuery(); [1]error image(http://prntscr.com/m5m4j3)
con.Open();
[2]error image(http://prntscr.com/m5m59o)
txtName.Clear();
txtSex.Clear();
txtClassLevel.Clear();
txtAddress.Clear();
txtEmail.Clear();
txtPhone.Clear();
txtReligion.Clear();
txtParentName.Clear();
txtStatus.Clear();
MessageBox.Show($"Data {txtName.Text} berhasil Ditambah ^_^ ", "Registrasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}