void Guncelle() { try { tblMarkalar frm = db.tblMarkalars.First(x => x.ID == MarID); frm.MarkaAdi = txtMarka.Text; db.SubmitChanges(); txtMarka.Text = ""; MarID = -1; Listele(); } catch (Exception) { MessageBox.Show("Güncelleme Hatası"); } }
void YeniKayıt() { try { tblMarkalar frm = new tblMarkalar(); frm.MarkaAdi = txtMarka.Text; db.tblMarkalars.InsertOnSubmit(frm); db.SubmitChanges(); txtMarka.Text = ""; Listele(); } catch (Exception e) { MessageBox.Show("Hata var Dostum" + e.Message); } }