OK, finally getting back to this. Sorry for the delay. 

I can definitely see the problem with this code fragment [4] - it's that
you're creating a new, empty FederationConfiguration and then trying to read
parameters from it. You want to get the one that FlexWiki has already
loaded. 

But if all you're trying to do is to provide a default value for the
connection string, it seems like the easiest way would be to change this
line [1] in SqlNamespaceProvider to this [2] (I've wrapped it for
readability - it's line 103 of SqlNamespaceProvider.cs on my machine). I
don't totally understand what you're trying to do, but I think "provide a
default connection string" is it. Maybe you're trying to set it up so they
*can't* change the connection string. In that case, remove the line [1] from
the code entirely, and then modify this method [3] to add a hardcoded string
instead of the ConnectionString. 

I'm not sure I really answered your question, though. :p

I was working on this section of code a while ago - it's pretty complicated,
frankly. 

[1]
_parameterDescriptors.Add(
  new NamespaceProviderParameterDescriptor(
    ConfigurationParameterNames.ConnectionString, 
    "ConnectionString", 
    "ConnectionString to the database. Format: Data Source=[Sql Server
Machine Name];Initial Catalog=FlexwikiSqlStore;Integrated Security=true;", 
    null, 
    true));
[2]

_parameterDescriptors.Add(
  new NamespaceProviderParameterDescriptor(
    ConfigurationParameterNames.ConnectionString, 
    "ConnectionString", 
    "ConnectionString to the database. Format: Data Source=[Sql Server
Machine Name];Initial Catalog=FlexwikiSqlStore;Integrated Security=true;", 
    "WPHHE185001-OV7\SQLEXPRESS;Initial Catalog=FlexwikiSqlStore;Integrated
Security=true;",   // Default value
    true));
[3] 

public void SavePersistentParametersToDefinition(NamespaceProviderDefinition
def)
{
    def.SetParameter(ConfigurationParameterNames.Namespace, Namespace);
    // Change this next line to set the connection string to some hardcoded
value
    def.SetParameter(ConfigurationParameterNames.ConnectionString,
ConnectionString);
}
 
[4] 

> private string DefaultedConnectionString
>         {
>             get
>             {
>                 FederationConfiguration config = new
> FederationConfiguration();
>                 NamespaceProviderParameter parm = new
> NamespaceProviderParameter();
>                 foreach (NamespaceProviderDefinition provider in
> config.NamespaceMappings)
>                 {
>                     foreach (NamespaceProviderParameter each in
> provider.Parameters)
>                     {
>                         if (each.Name == "ConnectionString")
>                         {
>                             parm = each;
>                             break;
>                         }
>                     }
>                 }
>                 return parm.Value;
>             }
>         }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flexwiki-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flexwiki-users

Reply via email to