Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SecurityDatabaseKey
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01177449
Message ID:
01177671
Views:
8
Hi!

Tried that but now I am getting an error "You must specify a DatabaseKey on the Picker control" (in the sample app) when I Select Orders from the Customer Menu pick and then click the Browse button.
   at OakLeaf.MM.Main.Business.mmPickListBusinessObject.SetDatabaseKey(String databaseKey)
   at OakLeaf.MM.Main.Windows.Forms.mmPicker.PerformSearch()
   at OakLeaf.MM.Main.Windows.Forms.mmPicker.btnPicker_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at OakLeaf.MM.NorthwindSample.Main.AppMainEntry.Main() in C:\Program Files\Mere Mortals .NET Framework 2005\Samples\MM Northwind Sample Application_CSharp\Main.cs:line 47
Here is my current app.config:
<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="databaseSets" type="System.Configuration.NameValueSectionHandler, 
         System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="databases" type="System.Configuration.NameValueSectionHandler, 
         System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
	<connectionStrings>
    <add name="OakLeaf.MM.NorthwindSample.Main.Business.Properties.Settings.NorthwindConnectionString"
      connectionString="Data Source=AppDBServer;Initial Catalog=Northwind;Integrated Security=SSPI;Persist Security Info=False"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SecurityDatabaseSetKey" value="CustA"/>
    <add key="SecurityDatabaseKey" value="SecurityDB"/>
    <add key="DatabaseSetDefault" value="CustA"/>
    <add key="SecurityEnabled" value="true"/>
    <add key="DisplayToolTips" value="true"/>

    <!-- Event Log, Trace Log and Transaction Log settings:
		1. The EventLog Level setting (options are "Error", "Warning", "Info", and "Verbose"
		2. The name of the machine on which the event log resides, default is "." (local machine)
		3. The name of the log
		-->
    <add key="EventLog\Level" value="Verbose"/>
    <add key="EventLog\Machine" value="."/>
    <add key="EventLog\Name" value="Application"/>

    <add key="TraceLog\Machine" value="."/>
    <add key="TraceLog\Name" value="Application"/>

    <add key="TransactionLog\Machine" value="."/>
    <add key="TransactionLog\Name" value="Application"/>

    <!-- If set to false, indicates the application is not localized,
		and uses hard-coded strings for displaying messages and
		for user interface text. If true, specifies the application uses
		mmMessageMgr to data-drive application text.
		-->
    <add key="LocalizeApp" value="false"/>

    <!-- Specifies the primary key of the default application language
	   (for localization purposes). Only used when LocalizeApp="true"
	    -->
    <add key="DefaultLanguage" value="1"/>

    <!-- Specifies the database key for application messages
		This key doesn't need to be specified if there is only one
		database in your application specified in the <databases> element.
		Only used when LocalizeApp="true"
		-->
    <add key="MessageDatabaseKey" value="Northwind"/>

    <!-- Specifies the default data acccess model: "local" or "webservice" -->
    <add key="DefaultDataAccessMode" value="local" />
	  
  </appSettings>
  <databaseSets>
    <add key="CustA" value="Customer A (SQL Server)" />
    <add key="CustB" value="Customer B (Visual FoxPro)" />
  </databaseSets>
  <databases>
	<add key="CustA\Northwind\Connection" value="server=AppDBServer;database=Northwind;Integrated Security=SSPI;Persist Security Info=False;" />
	<add key="CustA\Northwind\DataAccessClass" value="DataAccessSql" />
	<add key="CustB\Northwind\Connection" value="Provider=vfpoledb.1;Data Source=C:\Program Files\Mere Mortals .NET Framework 2005\Samples\VFPData\northwind.dbc" />
	<add key="CustB\Northwind\DataAccessClass" value="DataAccessOleDb" />
	<add key="CustA\SecurityDB\Connection" value="server=AppDBServer;database=SecurityDB;Integrated Security=SSPI;Persist Security Info=False;" />
	<add key="CustA\SecurityDB\DataAccessClass" value="DataAccessSql" />
  </databases>
  <system.windows.forms jitDebugging="true"/>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="EnvDTE" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
I am not clear about relationship between
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SecurityDatabaseSetKey" value="CustA"/>
    <add key="SecurityDatabaseKey" value="SecurityDB"/>
    <add key="DatabaseSetDefault" value="CustA"/>
and
  <databases>
	<add key="CustA\Northwind\Connection" value="server=AppDBServer;database=Northwind;Integrated Security=SSPI;Persist Security Info=False;" />
	<add key="CustA\Northwind\DataAccessClass" value="DataAccessSql" />
	<add key="CustB\Northwind\Connection" value="Provider=vfpoledb.1;Data Source=C:\Program Files\Mere Mortals .NET Framework 2005\Samples\VFPData\northwind.dbc" />
	<add key="CustB\Northwind\DataAccessClass" value="DataAccessOleDb" />
	<add key="CustA\SecurityDB\Connection" value="server=AppDBServer;database=SecurityDB;Integrated Security=SSPI;Persist Security Info=False;" />
	<add key="CustA\SecurityDB\DataAccessClass" value="DataAccessSql" />
  </databases>
and also where and who reads the "SecurityDatabaseSetKey", "SecurityDatabaseKey", "DatabaseSetDefault" settings.

Is this explained somewhere in the help file?

Thanks and sorry for the long thread

Sarosh

>Sarosh,
>
>Scroll towards the bottom of the config file and set the SecurityDatabaseKey value to the database key of the database that contains your security tables (such as User, Role, Security).
>
>For example:
>
>
<add key="SecurityDatabaseKey" value="Northwind" />
>
>This should point to a database key specified in the node of your config file. For example:
>
>
<databases>
>  <add key="Northwind\Connection" value="server=(local);uid=sa;pwd=;database=Northwind;" />
>  <add key="Northwind\DataAccessClass" value="DataAccessSql" />
></databases>
>
>Best Regards,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform