public void themBN(benhnhan bn) { System.Data.Common.DbTransaction my = dt.Connection.BeginTransaction(); try { dt.Transaction = my; dt.benhnhans.InsertOnSubmit(bn); dt.SubmitChanges(); dt.Transaction.Commit(); } catch (Exception ex) { dt.Transaction.Rollback(); throw new Exception("Loi them vao" + ex.Message); } }
partial void Deletebenhnhan(benhnhan instance);
partial void Updatebenhnhan(benhnhan instance);
partial void Insertbenhnhan(benhnhan instance);