Data Access Adapter problem

Posts   
 
    
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 13-Aug-2008 03:05:38   

Hello, I am using LLBL Gen Pro version 2.6 Final (June 6, 2008 ), Visual Studio 2005 8.0.50727.42, and an Oracle 10g database.

Recently I switched from using Adapter to Adapter, two class version. This was also after making some changes to the database, but all the changes seemed to be generated fine when I refreshed the schema.

However, when I rebuild in Visual Studio, it is only successful if I use the Net.2.0+ classes for the ORMSupportClass Library. However, in Visual Studio, I now get an error that the LLBLGenProDataSource2 can not be cast to LLBLGenProDataSource2. (I did make sure that LivePersistence was set to false.)

Can you advise me as to which version of the ORM Support libraries I should be using, and how to get the correct DataSource for the Adapter control in Visual Studio?

As an aside, I assumed that it would be better to go to the two class version of Adapter, in order to allow for customization and changes in the future. But perhaps I should stick with the basic Adapter (not two classes) version?

Thanks for any suggestions,

Carol

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Aug-2008 08:34:05   

Hi Carol, Adapter _TwoClasses _variant generates two classes per entity: entityNameEntity, which contains the generated plumbing code and MyentityNameEntity, which derives from that class and which is for your business logic. So, if you plan to put your business logic there, that would be a good option, otherwise, the General variant should be suficient.

About the compilation error: 1. ¿What are the platform setting when you generate code (.NET1.1, 2.0, 3.5)? 2. ¿Did you generate to the previous general Adapter folder? It's wise to generate to an empty folder if you are changing the preset. 3. Please post the details of the compilation error.

David Elizondo | LLBLGen Support Team
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 13-Aug-2008 19:31:41   

Hello David, Thank you for the quick reply. I am using Net2.0, and I put the details and stack trace below. I did create a new empty folder for the two class version of Adapter, but I generated it from the same LLBLGen Pro project as I used for the basic Adapter version. I removed all references, and then added them back and was able to get a successful build. However, when I run debug I get the error below. (I selected the .Net2.0+ version of the ORM Library.)

I'm guessing that somehow I have mixed source files. Perhaps it would be best to start a complete new project?

Thanks,

Carol

[FileLoadException: Could not load file or assembly 'SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] eaop.DatabaseSpecific.DataAccessAdapter.CreateDynamicQueryEngine() in C:\Documents and Settings\Carol\My Documents\LLBLGen Pro Projects\EAOPAdapter2\DatabaseSpecific\DataAccessAdapter.cs:387 SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateSelectDQ(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfoObjects, IPredicateExpression filter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +41 SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchTypedView(IEntityFields2 fieldCollectionToFetch, DataTable dataTableToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +524 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelectTypedView(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments) +724 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView2.ExecuteSelect(DataSourceSelectArguments arguments) +497 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +84 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +154 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99 System.Web.UI.WebControls.GridView.DataBind() +24 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +91 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +101 System.Web.UI.Control.EnsureChildControls() +134 System.Web.UI.Control.PreRenderRecursiveInternal() +109 System.Web.UI.Control.PreRenderRecursiveInternal() +233 System.Web.UI.Control.PreRenderRecursiveInternal() +233 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4421

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 13-Aug-2008 19:34:04   

Hello again, A brief addition to my post above. At first I didn't get errors, but also didn't get any data returned. To get the output in the stack trace I posted above, I had set LivePersistence to true, the original default setting.

Thanks, Carol

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Aug-2008 07:10:12   

Please double-check the references in the projects. Make sure you are referencing the correct ORMSupportClasses assembly (2.6) in your three projects (DatabaseGeneric, DatabaseSpecific, yourGUI).

David Elizondo | LLBLGen Support Team
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 16-Aug-2008 03:06:51   

I removed the references to the ORMSupportClasses and then added them back. First I selected the .Net.20+ version for all three locations (DatabaseGeneric, DatabaseSpecific, and the GUI).

With this the properties listed version 2.6.0.0, specific version = "True". However the runtime version lists v. 2.0.50727.

The build is successful, but I get the earlier problem of not getting data returned.

I then tried selecting the .Net.20 version (no plus in the name), and it shows as version 2.5.0.0, which I'm guessing is not the correct version, especially as I get many errors and the build fails, with errors including not being able to find the .dll assembly for the DatabaseGeneric version, i.e. "\DatabaseGeneric\bin\Debug\eaop.dll" (eaop is my base namespace).

Should I have a more recent runtime version of the ORMSupportClasses? Perhaps I should reinstall something?

Thanks,

Carol

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 16-Aug-2008 11:42:31   

As the issue is popping up in a Dynamic Query Engine, I think you've referenced the wrong DQE version (e.g. v2.5 instead of v2.6) in your project. Could you check that please? The v2.5 version of the DQE obviously referes to the ORMSupportClasses v2.5

Frans Bouma | Lead developer LLBLGen Pro
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 18-Aug-2008 19:54:27   

That did it!

I indeed did have version 2.5 of the DQE. I was using the Dynamic Query Engine for Oracle(8i/9i/10g) rather than the DQE for Oracle(8i/9i/10g/11g). Somehow I was focused on our database being 10g and this is the DQE I had used in the past. (It is now "obvious" that I needed to have the same version, 2.6, for both of the LLBLGenPro components.)

I also had to remove the references to the DatabaseGeneric and DBSpecific projects and add them back to the GUI project to get things refreshed correctly.

Thanks for your assistance. I am very glad to have things working again. This is a great product, and I'm slowly getting up to speed!

Carol

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Aug-2008 05:15:12   

Good to know it worked finally. Please come back if you need further assistance wink

David Elizondo | LLBLGen Support Team