Hi,
I'm getting a 'System.NullReferenceException' when I run the following code...
public int GetGuestID(int accountID, int ordinal)
{
DataAccessAdapter adapter = new DataAccessAdapter();
ResultsetFields fields = new ResultsetFields(1);
fields.DefineField(GuestFields.ContactId, 0, "ContactId");
IPredicateExpression expression = new PredicateExpression();
expression.Add(GuestFields.AccountId == accountID);
expression.AddWithAnd(GuestFields.Ordinal == ordinal);
return (int) adapter.GetScalar(fields, expression, null);
}
Here's the stack trace. This code used to work. I think its only since I upgraded to 2.6 that its broken.
at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore. AddInheritanceRelatedElementsToQueryElementsForDynamicList(InheritanceHierarchyType hierarchyType, IList fields, IPredicateExpression filter, IRelationCollection relations, IInheritanceInfoProvider infoProvider, String forEntityName)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetScalar(IEntityFields2 fields, IPredicate filter, IGroupByCollection groupByClause, IRelationCollection relations)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetScalar(IEntityFields2 fields, IPredicate filter, IGroupByCollection groupByClause)
at JGSR.BFWeekender.BusinessServices.AccountController.GetGuestID(Int32 accountID, Int32 ordinal) in G:\My Stuff\Development\Source\JGSREvents\Projects\Websites\BangfaceWeekender\JGSR.BFWeekender.BusinessServices\AccountController.cs:line 138
at JGSR.BFWeekender.Web.group.raver.btnSubmit_OnClick(Object sender, EventArgs e) in G:\My Stuff\Development\Source\JGSREvents\Projects\Websites\BangfaceWeekender\JGSR.BFWeekender.Web\group\raver.aspx.cs:line 91
Any ideas?
Cheers, Ian.