SubSonic Forums
All Your Database Are Belong To Us

Is there a way, or standard way to configure subsonic in code, without web.config junk?

Latest post 10-21-2008 5:18 AM by Juergen. 4 replies.
  • 10-20-2008 11:09 AM

    Is there a way, or standard way to configure subsonic in code, without web.config junk?

    I would like to have environment specific configuration for subsonic, I would like to do this in code, or in an arbitrary way.

    I have several subdomain web applications that hit the same data access dll, that uses subsonic, so I have to have this connection information scattered throughout my application.

    Filed under:
  • 10-20-2008 4:03 PM In reply to

    Re: Is there a way, or standard way to configure subsonic in code, without web.config junk?

     Yes - the best thing I can offer is to have a look at the source for SubCommander. There is a method in there called "SetProvider" which does exactly this.

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!

  • 10-20-2008 4:04 PM In reply to

    Re: Is there a way, or standard way to configure subsonic in code, without web.config junk?

  • 10-20-2008 4:20 PM In reply to

    Re: Is there a way, or standard way to configure subsonic in code, without web.config junk?

    Thanks, thats helpful for building the provider.

    My only question now, is at what point in time, must I ensure that my in memory provider is on the stack of cached providers?

    Do I need to ensure my provider is on the stack before every operation?

     

  • 10-21-2008 5:18 AM In reply to

    Re: Is there a way, or standard way to configure subsonic in code, without web.config junk?

    I use the settings in app.config only for convinience (so I do not need to pass the connection information to subcommander) but In my project I override the connection Information with:

    SubSonic.DataService.GetInstance("MyInstance").SetDefaultConnectionString("Server=" & serverString & ";Database=" & dbString & ";Uid=" & userString & ";Password=" & passString)

Page 1 of 1 (5 items) | RSS