private void UpdateBTN_Click(object sender, EventArgs e) { connect.Open(); SqlCommand command = new SqlCommand("update Customer set CustomerID='" + CustomerIDText.Text.ToString() + "',Name='" + NameText.Text.ToString() + "',Surname='" + SurnameText.Text.ToString() + "',Address='" + AddressText.Text.ToString() + "',Telephone='" + TelephoneText.Text.ToString() + "',Email='" + EmailText.Text.ToString() + "'where CustomerID=" + CustomerID + "", connect); command.ExecuteNonQuery(); connect.Close(); viewdetails(); CustomerIDText.Clear(); NameText.Clear(); SurnameText.Clear(); AddressText.Clear(); TelephoneText.Clear(); EmailText.Clear(); }
private void DeleteBTN_Click(object sender, EventArgs e) { connect.Open(); SqlCommand komut = new SqlCommand("Delete From Customer Where CustomerID=(" + sira + ")", connect); komut.ExecuteNonQuery(); connect.Close(); viewdetails(); viewdetails(); CustomerIDText.Clear(); NameText.Clear(); SurnameText.Clear(); AddressText.Clear(); TelephoneText.Clear(); EmailText.Clear(); }