Can not convert expression type system.nullable<byte> to return type short

Posts   
 
    
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 13-Sep-2006 04:03:44   

Hi i m getting the error on subject when i build my solution. here is the code section that gives the error:

/// <summary> The Age property of the Entity User<br/><br/> /// </summary> /// <remarks>Mapped on table field: "User"."Age"<br/> /// Table field type characteristics (type, precision, scale, length): TinyInt, 3, 0, 0<br/> /// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks> public virtual short Age { get { object valueToReturn = base.GetCurrentFieldValue((int)UserFieldIndex.Age);

            **return (Nullable<System.Byte>)valueToReturn;**
        }
        set { SetNewFieldValue((int)UserFieldIndex.Age, value); }
    }

bold line is gives the error. any ideas? thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Sep-2006 08:16:46   

Are you using any type converter on this field?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 08:31:42   

What are the settings of the field in the designer? (generate as nullable type, is that checked or not?)

Frans Bouma | Lead developer LLBLGen Pro
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 13-Sep-2006 16:53:59   

yes it is checked(nullable type) and no i m not using any type converter. the code i sent is what llblgen produced. thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 17:43:37   

e106199 wrote:

yes it is checked(nullable type) and no i m not using any type converter. the code i sent is what llblgen produced. thanks

Could you mail the .lgp file (just the project file) to support AT llblgen.com stating which preset you're using? I assume you're using the standard templates, not custom templates.

I'll then have a look to see what's wrong. I can't reproduce it here with our own testprojects. Also: which targetplatform and which template group.

Frans Bouma | Lead developer LLBLGen Pro
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 13-Sep-2006 18:08:54   

hi, c# .net 2.0 self servicing template binding: sqlserverspecific

i ll attach the lgb. thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 14-Sep-2006 21:19:24   

Not reproducable via email.

Frans Bouma | Lead developer LLBLGen Pro