﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Role Based Security  » SecurityDialog - Foreign Key Error (Project Code)</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:28:35 GMT</lastBuildDate><ttl>20</ttl><item><title>SecurityDialog - Foreign Key Error (Project Code)</title><link>http://forum.strataframe.net/FindPost11654.aspx</link><description>I have embedded the SecurityDialog in my prototype application.&lt;br&gt;
When the user adds Users or Roles, a Foreign Key error is thrown (on Project Code).&lt;br&gt;
Also the [i]securityForm.ProjectPK[/i] property == 0.&lt;br&gt;
&lt;br&gt;
The Security Key is valid ([i]SetSecurityKeyAndVectorForUserAuthentication[/i]) -- I can authenticate users and authorize access to Forms.&lt;br&gt;
&lt;br&gt;
Is this a configuration issue?&lt;br&gt;
Can you suggest a fix?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Below: stack trace for error when adding a user: &lt;br&gt;
&lt;br&gt;
   at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save(Boolean Transactional, String TransactionKey)&lt;br&gt;
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Save()&lt;br&gt;
   at MicroFour.StrataFrame.Security.UserEditor.cmdSave_Click(Object sender, EventArgs e)&lt;br&gt;
   at System.Windows.Forms.Control.OnClick(EventArgs e)&lt;br&gt;
   at System.Windows.Forms.Button.OnClick(EventArgs e)&lt;br&gt;
...</description><pubDate>Tue, 25 Sep 2007 16:05:46 GMT</pubDate><dc:creator>Zachary Paul Pennington</dc:creator></item><item><title>RE: SecurityDialog - Foreign Key Error (Project Code)</title><link>http://forum.strataframe.net/FindPost11689.aspx</link><description>Thanks, Trent.  You were right.&lt;br&gt;
&lt;br&gt;
I was still running locally, from the design-time "StrataFrame" database.&lt;br&gt;
I now understand that, even when running locally, we need to deploy the SFS data to a runtime database -- OK!&lt;br&gt;
&lt;br&gt;
[b]From "the manual" -- (SecurityHelp.chm)[/b]&lt;br&gt;
[quote]Without the DDT, you must manually add the SFS* tables to your database script for deployment and devise a method to [b]deploy the contents of the SFS* tables in the StrataFrame (design-time) database to your application’s database at runtime[/b]. You only need to gather the records that match your project, identified by the appropriate record within the SFSProjects table.[/quote]&lt;br&gt;
&lt;br&gt;
[quote]I am farily confident that you do not have the SecurityDataSource pointing to the right location...or...you do not have the security tables deployed to your database.[/quote]&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 25 Sep 2007 16:05:46 GMT</pubDate><dc:creator>Zachary Paul Pennington</dc:creator></item><item><title>RE: SecurityDialog - Foreign Key Error (Project Code)</title><link>http://forum.strataframe.net/FindPost11664.aspx</link><description>You do not have projects at run-time.&amp;nbsp; The ProjectPK is ONLY used through the Visual Studio designer so that you....the developer...can create projects that are deployed to your end-user.&amp;nbsp; When deployed, the projects table is not deployed and is not referenced or used.&amp;nbsp; This is for design-time purposes only.&lt;/P&gt;&lt;P&gt;There is really not enough of a stack trace to see the exact error.&amp;nbsp; However, I am farily confident that you do not have the SecurityDataSource pointing to the right location...or...you do not have the security tables deployed to your database.&amp;nbsp; By default the security data source will use the default data source.&amp;nbsp; So if your security tables are in the same database as your deployed database then you will not have any trouble and you do not need to set this.&lt;/P&gt;&lt;P&gt;When you indicate "embedded" are you just referring to calling the SecurityDialog() form through the SF reference or did you do something with the SF source code?&lt;/P&gt;&lt;P&gt;Any additional steps that you could provide would be helpful as well as a full stack trace.&amp;nbsp; Thanks. :)</description><pubDate>Mon, 24 Sep 2007 21:10:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>