no love with Dynamic TypedLists

Posts   
 
    
Jeff
User
Posts: 13
Joined: 28-Aug-2003
# Posted on: 30-Mar-2005 01:43:58   

I am trying to create a typed list via code. i created two new fields today on one of my tables, 2 of the 3 fields i need in this dynamic list. i have the following code in one of my methods:

DataAccessAdapter adapter = new DataAccessAdapter(); ResultsetFields fields = new ResultsetFields(3); fields.DefineField(ContactCustomFieldIndex.ContactId, 0, "Id", "ContactCustom"); fields.DefineField(ContactCustomFieldIndex.ContactPassword, 1, "Password", "ContactCustom"); fields.DefineField(ContactCustomFieldIndex.ContactUniqueName, 2, "UniqueName", "ContactCustom"); DataTable dynamicList = new DataTable(); adapter.FetchTypedList(fields, dynamicList, bucket); return dynamicList;

the bucket is just a simple relations bucket that adds a relation between two tables via the ContactID field.

The two fields ContactUniqueName and ContactPassword are the 2 new fields that i added today to the db. I built the db schema, genreated the code, and added this new code to my solution. everything seems to work fine, i get intellisense on these fields in the entity and in the fields enum.

When i test this, I get the error listed below. I have tried everything i can think of, i downloaded the latest llblgen bits today, used those and rebult everything, referened the dqe and support dlls from that download, so this way i have the latest code from llblgen. Here is the weird part, if i replace those two fields with other fields that have been there for a while, it works fine. Its like it has something to do with those fields being brand new, but that makes no sense; to me anyways. I have spent way to long on this, i have to stop and move on... please help. Is there some stupid little thing i am doing wrong???

==================================== Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 588: bool allowDuplicates, IGroupByCollection groupByClause, int pageNumber, int pageSize) Line 589: { Line 590: return DynamicQueryEngine.CreateSelectDQ(fieldsToFetch.GetAsEntityFieldCoreArray(), Line 591: persistenceInfoObjects, base.GetActiveConnection(), filter, maxNumberOfItemsToReturn, sortClauses, relationsToWalk, allowDuplicates, groupByClause, pageNumber, pageSize); Line 592: }

Source File: ....\DataAccessAdapter.cs Line: 590

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator.CreateFieldName(IFieldPersistenceInfo persistenceInfo, String fieldName, String objectAlias, Boolean appendAlias) +437 SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator.CreateFieldName(IEntityFieldCore fieldCore, IFieldPersistenceInfo persistenceInfo, String fieldName, String objectAlias, Int32& uniqueMarker, Boolean applyAggregateFunction) +163 SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32& uniqueMarker) +525 SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +101 Gallery.DAL.DatabaseSpecific.DataAccessAdapter.CreateSelectDQ(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfoObjects, IPredicateExpression filter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) in D:\Jeff\My Documents\Work\Solutions\Ariel\New\Gallery\DAL\DatabaseSpecific\DataAccessAdapter.cs:590 SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchTypedList(IEntityFields2 fieldCollectionToFetch, DataTable dataTableToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) +261 SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchTypedList(IEntityFields2 fieldCollectionToFetch, DataTable dataTableToFill, IRelationPredicateBucket filterBucket) +27 Gallery.Core.Managers.ContactCustomManager.LoginCredentials(String contactId, String uniqueName, String email, String password) in d:\jeff\my documents\work\solutions\ariel\new\gallery\core\managers\contactcustommanager.cs:88 Gallery.Core.BLL.Shared.Contact.LoginToken.LoadCredntials(String uniqueName, String email, String password) in D:\Jeff\My Documents\Work\Solutions\Ariel\New\Gallery\Core\BLL\Shared\Contact\LoginToken.cs:89 Agora.Web.Controls.FormParts.Contact.Login.ContactFound(String email, String uniqueName) in D:\Jeff\My Documents\Work\Solutions\Ariel\New\Agora\Web\Controls\FormParts\Contact\Login.ascx.cs:105 Agora.Web.Controls.FormParts.Contact.Login.btnSubmit_Click(Object sender, ImageClickEventArgs e) in D:\Jeff\My Documents\Work\Solutions\Ariel\New\Agora\Web\Controls\FormParts\Contact\Login.ascx.cs:59 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +109 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +69 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 30-Mar-2005 11:41:14   

I think it's due to a non-updated database specific project, i.e.: it's out of sync with your entity (database generic) project. Please check if the database specific assembly is indeed updated on the webserver and that the persistenceinfofactory.cs file is updated in the database specific project so you'll have indeed the right persistence info for these 2 new fields.

Frans Bouma | Lead developer LLBLGen Pro
Jeff
User
Posts: 13
Joined: 28-Aug-2003
# Posted on: 30-Mar-2005 17:38:27   

Man, what a Dumb A$$ I am. Thanks for the help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 30-Mar-2005 18:21:22   

smile you're welcome, Jeff simple_smile

Frans Bouma | Lead developer LLBLGen Pro