AddDays is not a member of Date? Error LLBLGen Pro 2.6

Posts   
 
    
BClausen
User
Posts: 4
Joined: 03-Apr-2009
# Posted on: 10-Apr-2009 19:05:19   

We are converting form LLBLGen Pro 1.x to LLBLGen Pro 2.6. During conversion we got this error in our data access code "AddDays is not a member of Date?". We have not found how to correct this. This is Asp.Net app, coding in VB.Net. This is a simplified version of the code:

If objPAID.CreatedDate.AddDays(6) < Now.Date Then Do things... End if

objPAID.CreatedDate is information from a table and column

LLBLGen Pro 2.6 Self-servicing Windows XP Visual Studio 2008 SP1 .Net 3.5 Sql Server 2005

Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 10-Apr-2009 23:06:01   

The reason why that will not work is because the data-type is NOT datetime, but Nullable<DateTime>. You should therefore do objPAID.CreateDate.Value.AddDays(6). If this is not what you intended, then your column in the db should have a NOT NULL in its specification.

BClausen
User
Posts: 4
Joined: 03-Apr-2009
# Posted on: 11-Apr-2009 00:07:29   

Thanks,

It appears that this is working for us.

BClausen