Invalid Column name on generated code

Posts   
 
    
MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 28-Jan-2010 15:39:36   

Hi there,

I am using the LinqMetaData layer and am getting some weird generated code:

We are using LLBGen Pro 2.6, .net 3.5 C#, self servicing..

We are getting a bunch of fields which look like this:

     [LPA_L1].[Latitude]         AS [F7_14],
     [LPA_L1].[Longitude]       AS [F7_15],
     [LPA_L1].[PlaceTypeId]   AS [F7_16],
     [LPA_L1].[PlaceId]       AS [F4_17],

-- [LPA_L1].[F4_18], -- [LPA_L1].[F4_19], -- [LPA_L1].[F4_20], -- [LPA_L1].[F4_21], -- [LPA_L1].[F4_22], -- [LPA_L1].[F4_23],

Unsurprisingly the database is throwing "invalid column name" exceptions

Any ideas?

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 28-Jan-2010 22:44:09   

Please can you post the code which is causing this error ?

Matt

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 08:19:42   

Hi there,

The linq to llblgen query looks like this:

            LinqMetaData lmd = new LinqMetaData();
            var locs = from l in lmd.Location
                       select l;
            foreach (LocationEntity loc in locs)
            {
//              var placesInLoc = from p in lmd.Place
//                                join prl in lmd.ProductRootLocations on p.ContentId equals prl.Spid
//                                where prl.LocationId == loc.LocationId
//                                && p.Status == (short)HB.ContentStatus.Live
//                                select p;

The Place Entity is a sub-entity of the Content Entity, which in turn is a sub-entity of the ID Entity, so LLBLGen generates a series of joins not directly reflected in the Linq

The schema has changed a bit, but not in ways which directly affect this structure. I have regenerated the LinqMetaData class several times.

Not sure where these phantom fields are coming from

thanks for your input

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Jan-2010 10:32:01   

Which runtime library build are you using?

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 10:44:45   

Hi there,

Which binaries specifically?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Jan-2010 10:50:47   

The ORMSupportClasses & the LinqSupportClasses dlls, please check the below link to know how to get the build/version number. http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725

Thanks.

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 11:58:47   

Hi again,

SD.LLBLGen.Pro.LinqSupportClasses.NET35.dll 2.6.8.616

SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll 2.6.8.624

Also, the database is SQL Server 2005.

thanks,

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Jan-2010 12:21:37   

These are old enough simple_smile

Would you please upgrade to the latest releases, and see if the problem still exists.

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 12:33:26   

Thanks, is there a forum post detailing how to upgrade the libraries?

I assume I have to update my various project binaries, as well as the files in the runtimelibraries folder in the LLBLGen Pro v2.6 folder?

I've done it before, but remember being pretty hazy about which binaries to replace, and in what folders.

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 12:52:28   

OK - I see the readme file explains it.

I'll post back after upgrade

MattE avatar
MattE
User
Posts: 77
Joined: 11-Sep-2007
# Posted on: 29-Jan-2010 13:50:56   

Ok - my bad. That seems to have resolved it.

Should have checked all that first.

thanks for the help..