llblgen is adding the database name where it shouldnt

Posts   
 
    
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 04-Feb-2009 00:33:17   

Hi, i have a database Called MyDB and several tables in it. Created the llblgen project. Using the catalog MyDB i chose the entities i want in my project and generated the code. it is ms sql 2008 express, llblgen 2.6, C#, .net 1.1, self servicing

One entity in my project is called User. calling the User.Save() method gives an error like

Invalid object name MyDB.dbo.User

In my connection string i have my initial catalog set as ABC (not myDB). why is llblgen adding the catalog name before the table name? there is no such object of course since its a different database. I changed the name of the db to MyDB1, refreshed the catalog and selected MyDB1 as the new catalog since MyDB isnt there anymore and regenerated teh project and this time i am getting

Invalid object name MyDB1.dbo.User

Am i doing something wrong here? thanks

-shane

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Feb-2009 06:32:24   

Please follow step 1 of this post: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=13082&StartAtMessage=0&#72683

And, if you want to make the connection string (or catalog name) change at code, go on step 2.

David Elizondo | LLBLGen Support Team
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 04-Feb-2009 14:21:32   

daelmo wrote:

Please follow step 1 of this post: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=13082&StartAtMessage=0&#72683

And, if you want to make the connection string (or catalog name) change at code, go on step 2.

i dont think this is what i need. In my web.config i have my connection string and my initial catalog is definited there. Isnt the generated code supposed to use it? I dont want to change anything at runtime. Even though i have MyDB1 as the initial catalog name in my web.config, the generated code is still looking for MyDB as the catalog.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 04-Feb-2009 15:03:57   

The catalog name is hardcoded, coz you can have entities from multiple catalogs in the same project.

So if you want to change the catalog namne please, use the Catalog Name Overwrites section in the config file.

e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 04-Feb-2009 17:18:28   

Walaa wrote:

The catalog name is hardcoded, coz you can have entities from multiple catalogs in the same project.

So if you want to change the catalog namne please, use the Catalog Name Overwrites section in the config file.

thank you. that helped.