Adapter using SQLServer

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 13-Oct-2005 00:13:30   

I haven't used LLBLGen for a month or so now, but today when I generated my code and then did my first FetchEntityCollection, I got a "Object not set to an instance" error.

I traced it down to the method in my DataAccessAdapter code named ReadHandleCatalogNameSettingFromConfig. Now, I fixed my problem by adding in the two app settings it was looking for (CatalogNameUsageSetting and CatalogNameToUse) but I was confused because I never had to do that before. I looked in the generated app.config files and they aren't in there. Did something change in the last month or has that been around for a while? If it has been around for a while, why wasn't I affected by it before?

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 13-Oct-2005 04:38:28   

Nick,

Take a look at this LLBLGen User Manual page for a full explanation of what's going on with these properties:

Generated code - DataAccessAdapter Functionality, Adapter "Catalog specific persistence info (SqlServer specific)"

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 13-Oct-2005 09:35:58   

So to recap, you didn't have any config file settings in your .config file besides the connection string?

Frans Bouma | Lead developer LLBLGen Pro
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 13-Oct-2005 17:17:48   

Otis wrote:

So to recap, you didn't have any config file settings in your .config file besides the connection string?

Exactly. Now, in the connection string I had "initial catalog" but I don't think your code was examining the actual string itself, was it?

NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 13-Oct-2005 17:18:40   

Paul.Lewis wrote:

Nick,

Take a look at this LLBLGen User Manual page for a full explanation of what's going on with these properties:

Generated code - DataAccessAdapter Functionality, Adapter "Catalog specific persistence info (SqlServer specific)"

Thanks, Paul. That's how I figured out how to fix the problem. So I undertand it was my fault to begin with, but it seemed odd to me that it worked before when these settings were absent.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 13-Oct-2005 17:34:44   

It should work without these settings present. (so with a config file with solely an appsettings section with a connection string). Though if you define the sections at the top of the config file and not add the actual sections to the config file, it won't work.

Frans Bouma | Lead developer LLBLGen Pro