Message 1 of 2
Add Property to .Net Project - PnPDatabaseMode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the following code to add a property to a table.
var prj = PlantApplication.CurrentProject.ProjectParts["Piping"]; PnPDatabaseMode prevMode = prj.Mode; prj.Mode = PnPDatabaseMode.Exclusive; using (PnPDatabase db = PnPDatabase.Open(prj.DataCacheFile)) { PnPTable enginitems = db.Tables["EngineeringItems"]; if (enginitems.Columns.Contains(projectcolum)) return; PnPColumn col = new PnPColumn(projectcolum, typeof(string), PnPDatabase.DefaultStringValueLength); enginitems.Columns.Add(col); db.AcceptChanges(); } prj.Mode = prevMode;
However, I get an error in the Datalinksmanager when I try to set the PnPDatabaseMode to Exclusive. Any ideas?
The PnPDatabaseMode was shared, but the error says it's already opened exclusive.