I hate these three tables, there are many relationships in two tables and as such it generates a third of the table.
I used Linq- To-SQL and .dbml files, I've dragged all the folders to the graphic surface there.
Here I am using an area to safely remove Remember that documents are connected to a region, so I can not delete it and leave the document hanging.
ScansDataContext db = new ScansDataContext (); /// & lt; Summary & gt; Deletes Area Objects from Database with All Associations in the /// Database. /// & lt; / Summary & gt; /// & lt; Ultimate name = "area" & gt; To save the area object & lt; / Param & gt; Public Zero Removal (Area Areas) {db.DocumentAreaRelations.DeleteAllSubmit (field.Documentary Array Reference); Db.Areas.DeleteOnSubmit (field); Db.SubmitChanges (System.Data.Linq.ConflictMode.FailOnFirstConflict); }
Believing that you still have to implement relationships There are obstacles in the database. It seems that I should be good to go. If you do not have the keys to the database, then you have to add them.
You want to delete all the relationships first, second the actual unit and submit ()
wrap everything in a local transaction so that it is a unit of work.
Comments
Post a Comment