Multiple Version

Posts   
 
    
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 27-Jan-2009 18:13:25   

I think this question has been asked before (possibly by me confused ) but here goes anyways:

I have an old LLBL adapter project (version 1.0.2005.1) for .net 2.0 used on one database. I now have a new database and I want to use adapter version 2.6 for .net 3.5.

So, in my program I want to be able to reference both the 1.0.2005.1 and 2.6 entities.

Can I do that? If so, how?

Thanks,

Fishy

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 27-Jan-2009 21:20:19   

As long as your LLBLGen generated components from each version have sufficiently different namespaces and names such that there are no clashes you should have no trouble referencing both sets.

Matt

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 27-Jan-2009 21:31:25   

I tried adding the 2.6 reference and I get the following error:

A reference to 'LLBLGen Pro .Net 2.0+ ORM Support Classes Library' could not be added. A reference to the component 'SD.LLBLGen.Pro.ORMSupportClasses.NET20' already exists in the project.

Is there a way of getting around this?

Thanks

Fishy

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Jan-2009 07:13:30   

Hi Fishy.. IMHO, I think that is not possible. What not just upgrade? simple_smile or.. please elaborate more on what you are trying to do.

David Elizondo | LLBLGen Support Team
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 28-Jan-2009 16:43:05   

daelmo wrote:

Hi Fishy.. IMHO, I think that is not possible. What not just upgrade? simple_smile or.. please elaborate more on what you are trying to do.

I tried updating in the past and ran into issues (which I don't remember disappointed ).

But, it's a new day simple_smile and I will start the upgrading process.

Thanks,

Fishy.

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 28-Jan-2009 18:29:19   

I get the following error after I upgrade:

'Find' is not a member of 'MedfordSchoolDistrict.Elementary.GradeBook.LLBL.HelperClasses.EntityCollection'.

I could not find a resolution. What is the correct way of doing a Find?

Thanks,

Fishy

Edit: Here is the Code:


    Public Shared Function FindGroupStudentByStudentIdent(ByVal groupStudentCollection As EntityCollection, ByVal studentIdent As Integer) As Integer
        Dim i As Integer

        i = groupStudentCollection.Find(New EntityPropertyDescriptor2(EntityFieldFactory.Create(Elementary.GradeBook.LLBL.GroupStudentFieldIndex.StudentIdent), _
          GetType(GroupStudentEntity), False), studentIdent)

        Return i
    End Function

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 28-Jan-2009 18:41:08   

Please use FindMatches() instead of Find().

Also you can use an EntityView

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 28-Jan-2009 19:07:27   

So, my new code looks like this:

    Public Shared Function FindGroupStudentByStudentIdent(ByVal groupStudentCollection As EntityCollection, ByVal studentIdent As Integer) As Integer
        Dim i As System.Collections.Generic.List(Of Integer) = groupStudentCollection.FindMatches(GroupStudentFields.StudentIdent = studentIdent)

        If i.Count > 0 Then
            Return i(0)
        Else
            Return -1
        End If

    End Function

I haven't tested it, but does this look correct?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 28-Jan-2009 19:14:22   

From my humble VB experience I think your code looks fine. simple_smile