﻿<?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  » The DataSourceKey [XXX] is not defined.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 09 Sep 2026 04:49:03 GMT</lastBuildDate><ttl>20</ttl><item><title>The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5147.aspx</link><description>The full error I am getting is:&lt;br&gt;
	An error occurred while creating a new DataLayer for the business object.&lt;br&gt;
	The DataSourceKey [XXX] is not defined.&lt;br&gt;
&lt;br&gt;
This error is generated on the call to:&lt;br&gt;
 SFSPreferencesBO.RetrieveSecurityPreferences()&lt;br&gt;
&lt;br&gt;
Everything works fine* when I don't add a named datasourcekey but leave the default "" : &lt;br&gt;
SecurityBasics.SecurityDataSourceKey = "XXX"&lt;br&gt;
&lt;br&gt;
I tried adding this but it didnt help:&lt;br&gt;
DataLayer.DataSources.Add(New SqlDataSourceItem("XXX", "Data Source=IPADDRESS\SQLNAME;Initial Catalog=DBNAME;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True"))&lt;br&gt;
&lt;br&gt;
I have a security project with a security key that matches.&lt;br&gt;
&lt;br&gt;
I have my security tables in the same database as my application files, added via the DDT and deployed to the SQL Server.&lt;br&gt;
&lt;br&gt;
I am sure I am doing something dumb, as this is the first chance i have had to implement the security module.&lt;br&gt;
&lt;br&gt;
Keith&lt;br&gt;
&lt;br&gt;
* when I left the SecurityDataSourceKey = "", I could only see the users within my app, when I called up the SecurityDialog from within VS, I saw no users.&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 12 Dec 2006 09:47:41 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5224.aspx</link><description>You have the right picture with the exception of the SFSProjects table.&amp;nbsp; The SFSProjects should &lt;STRONG&gt;NOT&lt;/STRONG&gt; be redeployed as this is used within the design-time aspect of the RBS editor only.&amp;nbsp; The SFSProjects allows you to create security permissions, users, roles, etc. for different projects or applications.</description><pubDate>Tue, 12 Dec 2006 09:47:41 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5215.aspx</link><description>Was driving me nuts, so I dug a little deeper.&lt;br&gt;
&lt;br&gt;
Typo on the security key in my security project, so it didn't match the SetSecurityKeyAndVectorForUserAuthentication in Appmain.&lt;br&gt;
&lt;br&gt;
All is well, if you can just read the summary above and make sure I now (finally) have the right picture, I would appreciate it.&lt;br&gt;
&lt;br&gt;
:blush:</description><pubDate>Mon, 11 Dec 2006 22:40:09 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5214.aspx</link><description>&lt;sigh&gt; &lt;br&gt;
&lt;br&gt;
close....&lt;br&gt;
&lt;br&gt;
the user that was deployed from the package show in my application when I call SecurityDialog, but it says it is corrupt. I am going to wait for some guidance.</description><pubDate>Mon, 11 Dec 2006 22:16:51 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5213.aspx</link><description>OK, I get it.&lt;br&gt;
&lt;br&gt;
You have to do everything in the Strataframe database first, then deploy to your application. The deployment wizard "sucks out" the correct related security data (as defined in the security project by the key) and sens it to the application database, from there you can add/modify users and roles but not permissions. Do I have it?&lt;br&gt;
&lt;br&gt;
I was doing things right in my target database off the bat.</description><pubDate>Mon, 11 Dec 2006 22:12:27 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5212.aspx</link><description>Should SFSProjects have been created along with the other security tables in my application database? If yes, then that is the issue, it was not. &lt;br&gt;
&lt;br&gt;
If not then I am just lost.&lt;br&gt;
&lt;br&gt;
Here is where I am. Everything works fine within my application, I can create users, roles, everything but permissions as stated above by calling the dialog from within my app. I removed the DataSourceKey since you said I didn't need it.&lt;br&gt;
&lt;br&gt;
My issue is still this, I cannot see my security data in Visual Studio to add permissions. I figured this is because my connection string points to the Strataframe database (also with security tables), so I changed it (actually added) and new connection to my application database from within the Security Editor.... that is where I got all kinds of errors related to SFSProjects not existing, which it does not in my application database, as created using "add security tables" in the DDT. The "Strataframe" db has 10 security tables, mine has 9. &lt;br&gt;
&lt;br&gt;
I either do not understand where/how security projects tie into the security data or I do and the DDT forgot to add one table for some reason so i cant switch to my app database in the Security Editor to work with my apps users/roles/etc.&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 11 Dec 2006 21:52:09 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5190.aspx</link><description>[quote]I have my security tables in the same database as my application files, added via the DDT and deployed to the SQL Server.[/quote]&lt;/P&gt;&lt;P&gt;Then you do not need to set the SecurityDataSourceKey as the security key will reference your application database or default connection.&lt;/P&gt;&lt;P&gt;[quote] and i cant see my "live" users (created from within the SecuritDialog within my app) from within VS. [/quote]&lt;/P&gt;&lt;P&gt;The first question is that did you deploy your users to your application database?&amp;nbsp; By default this will be empty.&amp;nbsp; Also, make sure you call the SecurityBasics.SetSecurityKeyAndVectorForUserAuthentication("yourPresharedKey") in the InitApplication otherwise you will not see any user.&amp;nbsp; In fact, you will get an error.&lt;/P&gt;&lt;P&gt;[quote]This also brings me to another question, are security roles then only available for add/edit at design time, that doesn't seem right? [/quote]&lt;/P&gt;&lt;P&gt;No.&amp;nbsp; You cannot create permissions as run-time.&amp;nbsp; This would not make sense since the end-users should not be able to create permissions.&amp;nbsp; If the end-user created the permissions they would never be implemented within the code (or tested on by you the developer).&amp;nbsp; They would just be "hollow" permissions that did not do anything.</description><pubDate>Mon, 11 Dec 2006 14:00:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5184.aspx</link><description>The above should say "permissions" not "roles" as far as the design time questions.&lt;br&gt;
&lt;br&gt;
&lt;&lt; still hoping for an edit capability on ones own posts&gt;&gt;</description><pubDate>Mon, 11 Dec 2006 08:07:44 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: The DataSourceKey [XXX] is not defined.</title><link>http://forum.strataframe.net/FindPost5183.aspx</link><description>I thought i could plow on just using "", but I cannot add permission sets from within my app (I assume this is intended) and i cant see my "live" users (created from within the SecuritDialog within my app) from within VS. &lt;br&gt;
&lt;br&gt;
This also brings me to another question, are security roles then only available for add/edit at design time, that doesn't seem right?</description><pubDate>Mon, 11 Dec 2006 08:05:37 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item></channel></rss>