Get catalog name to use in adapter.

Posts   
 
    
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 29-Nov-2004 05:42:31   

Should it be possible for me to subclass DataAccessAdapter in such a way that it can read the connection string to determine the catalog name?

And if that's not possible, here's the real problem at hand. I'm packaging up a new DotNetNuke module, but don't want the installation process to require the user to modify the web.config in order to specify the CatalogNameToUse.

The only thing I can think of to do would be to subclass DataAccessAdapter, as mentioned above, but I don't understand why Frans didn't do that in the first place.

I haven't tried this yet, but I would appreciate anyone's feedback before I dive in (I've got other things to do in the meantime).

Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 29-Nov-2004 09:25:23   

you can subclass it to do that of course. I didn't implement it that way, because I didn't want to do string parsing to find out a value, which also could be supplied.

Frans Bouma | Lead developer LLBLGen Pro
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 03-Jan-2005 03:23:18   

Otis wrote:

you can subclass it to do that of course. I didn't implement it that way, because I didn't want to do string parsing to find out a value, which also could be supplied.

Just now getting back to this. What function do I need to override to set the new catalog name?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Jan-2005 10:27:03   

alexdresko wrote:

Otis wrote:

you can subclass it to do that of course. I didn't implement it that way, because I didn't want to do string parsing to find out a value, which also could be supplied.

Just now getting back to this. What function do I need to override to set the new catalog name?

See the DataAccessAdapter Functionality documentation in Using the generated code / Adapter

Frans Bouma | Lead developer LLBLGen Pro
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 04-Jan-2005 16:42:50   

Otis wrote:

See the DataAccessAdapter Functionality documentation in Using the generated code / Adapter

I'll post the code I finally came up with, but the documentation is clearly lacking here. Simply referring me to the docs wasn't enough to solve my problem.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 04-Jan-2005 17:18:16   

alexdresko wrote:

Otis wrote:

See the DataAccessAdapter Functionality documentation in Using the generated code / Adapter

I'll post the code I finally came up with, but the documentation is clearly lacking here. Simply referring me to the docs wasn't enough to solve my problem.

May I ask what lacked? Because that part of the documentation discusses 3 ways to set the catalog name for an existing generated code base: either through .config file settings or by passing in a name in the constructor or by setting properties on the dataaccessadapter...

There is no functionality build in which chops up a connection string. So all functionality which will grab the catalog name from some place has to do that itself and pass it to the dataaccessadapter class either in the constructor or through the properties (which reflect the same settings as the constructor sets)

Frans Bouma | Lead developer LLBLGen Pro