property cannot be declared 'Overrides' because it does not override a property in a base class

Posts   
 
    
JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 21-Feb-2008 12:23:28   

Sorry if this is a duplicated question or a silly one! I did a few searches but I couldn't find anything.

I am using LLBLGen Pro 2.5 Final (October 25th, 2007) I had been using VB in Visual Studio 2005 but I've switched to 2008.

I have played around with generating the code for .NET 2.0 and .NET 3.0 but the application I am developing needs to run against .NET 2.0

I have recently regenerated the code and I'm getting errors associated with some of my custom code.

I used to have a function in BookingDetailEntity which started:

Public Overrides Property checkin() As Date
    Get
        Return MyBase.CheckIn
    End Get
    Set(ByVal Value As Date)
        MyBase.CheckIn = Value

Now I'm getting errors including: 'Public Overridable Property CheckIn() As Date' has multiple definitions with identical signatures. property 'checkin' cannot be declared 'Overrides' because it does not override a property in a base class.

The entity file used to inherit BookingDetailEntityBase and now it inherits CommonEntityBase which I assume is related.

What do I have to do to get round this?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 21-Feb-2008 14:32:01   

Public Overrides Property checkin() As Date Get Return MyBase.CheckIn End Get Set(ByVal Value As Date) MyBase.CheckIn = Value

Are you trying to override a property in a base class? Otherwise remove the Overrides keyword?

JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 21-Feb-2008 14:50:11   

If I do that, the LLBLGen generated property gives the error: 'Public Overridable Property CheckIn() As Date' has multiple definitions with identical signatures.

Public Overridable Property [CheckIn]() As System.DateTime
    Get
        Return CType(GetValue(CInt(BookingDetailFieldIndex.CheckIn), True), System.DateTime)
    End Get
    Set
        SetValue(CInt(BookingDetailFieldIndex.CheckIn), value, True)
    End Set
End Property
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 21-Feb-2008 15:04:40   

I'm confused confused

Inside which class is the following generated:

Public Overridable Property [CheckIn]() As System.DateTime
    Get
        Return CType(GetValue(CInt(BookingDetailFieldIndex.CheckIn), True), System.DateTime)
    End Get
    Set
        SetValue(CInt(BookingDetailFieldIndex.CheckIn), value, True)
    End Set
End Property

And in which class do you try to have this:

Public Overrides Property checkin() As Date
    Get
        Return MyBase.CheckIn
    End Get
    Set(ByVal Value As Date)
        MyBase.CheckIn = Value

(Edit) Would you please try the following?

Public Overrides Property CheckIn As System.DateTime Get Return MyBase.CheckIn End Get Set(ByVal Value As Date) MyBase.CheckIn = Value

JMitchell avatar
JMitchell
User
Posts: 128
Joined: 01-Sep-2006
# Posted on: 21-Feb-2008 15:23:14   

Both in BookingDetailEntity. I'm trying to do some manipulation of other fields when this field is modified so if there is an easier way to do this that would be nice. It worked before...

When I used Public Overrides Property CheckIn As System.DateTime I got the error: property 'CheckIn' cannot be declared 'Overrides' because it does not override a property in a base class.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 22-Feb-2008 10:29:58   

Both in BookingDetailEntity.

You can only use Overrides to override a property or method in a base class not in the same class.

I'm trying to do some manipulation of other fields when this field is modified so if there is an easier way to do this that would be nice. It worked before...

You can use events such as: OnFieldValueChanged OnPropertyChanged