ResultSetFields.DefineField

Posts   
 
    
newbie
User
Posts: 2
Joined: 17-Jun-2008
# Posted on: 17-Jun-2008 17:57:22   

Hi,

We have recently downloaded the 2.6 version, the following code which works perfectly in 2.5 did not compile with the new version. .Net 2.0, Sql Server with SelfServicing template mode is being used. Any help will be appreciated. Thanks

Code:

        ResultsetFields oResultsetFields = new ResultsetFields(2);
        oResultsetFields.DefineField(HotelInfoChainCodesFieldIndex.Id, 0, "ID");

Error:

Error 6 The best overloaded method match for 'SD.LLBLGen.Pro.ORMSupportClasses.EntityFields.DefineField(SD.LLBLGen.Pro.ORMSupportClasses.IEntityField, int, string)' has some invalid arguments

Error 7 Argument '1': cannot convert from HotelInfoChainCodesFieldIndex' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField'

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 18-Jun-2008 10:43:22   

Instead of:

oResultsetFields.DefineField(HotelInfoChainCodesFieldIndex.Id, 0, "ID");

you should use:

oResultsetFields.DefineField(HotelInfoChainCodesFields.Id, 0, "ID");
newbie
User
Posts: 2
Joined: 17-Jun-2008
# Posted on: 18-Jun-2008 14:26:50   

Hi,

I have to change lots of lines of codes in lots of files that way rage Is the previous version of DefineField method deprecated. ?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 18-Jun-2008 15:17:40   

Is the previous version of DefineField method deprecated. ?

That's the case since v.2.0 was released.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Jun-2008 20:35:08   

As Walaa said, the DefineField overloads were deprecated since v2.0. We shipped backwards compatibility templates in v2.5 and in v2.6. In v2.5 they were placed above the normal ones, but in v2.6 we moved them below the normal ones in the 2nd tab in the generator configuration dialog. If you want them to be placed as first templates, please place them above the normal ones at tab 2.

Though I'd change the code and stick with the newer DefineField, as it is a lot less code and Intellisense is much faster as it could lead to a lot of overloads in vs.net...

Frans Bouma | Lead developer LLBLGen Pro