extending LLBLGen GUI Templates for asp.net

Posts   
 
    
oki
User
Posts: 27
Joined: 12-Sep-2007
# Posted on: 18-Feb-2008 15:52:56   

I'm triing to extend the LLBLGen GUI Templates. (LLBLGen Pro 2.5, Adapter, SQL Server) I use the generated UserControls Search<EntityName>.ascx in other Pages. based on the ListSubset.aspx, I'd like to implement the searcherClicked Eventhandler in the aspx-Page to retrieve the Predicate and display the Predicate in a Label, but it thows a NullReferenceException in the .ToQueryText Method:


System.NullReferenceException was unhandled by user code
  Message="Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."
  Source="SD.LLBLGen.Pro.DQE.SqlServer.NET20"
  StackTrace:
       bei SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator.CreateParameter(IEntityFieldCore field, IFieldPersistenceInfo persistenceInfo, ParameterDirection direction, Object valueToSet)
       bei SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareValuePredicate.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
       bei SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
       bei SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker)
       bei HelperControls_SearchMultiView.searcher_SearchClicked(Object sender, EventArgs e) in j:\Entwicklung\ZKS2007\Head180208\Server\WebApplication\WebSite\HelperControls\SearchMultiView.ascx.cs:Zeile 150.
       bei Controls_SearchWebPersonal.btnSearchSubSet_Click(Object sender, EventArgs e) in j:\Entwicklung\ZKS2007\Head180208\Server\WebApplication\WebSite\Controls\SearchWebPersonal.ascx.cs:Zeile 248.
       bei System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       bei System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       bei System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       bei System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       bei System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The coresponding code Snippet:


    private ISearchControl _searcher;

    private void searcher_SearchClicked(object sender, EventArgs e)
    {
        if (_searcher != null) 
        {
            int i = 0;
            _searcher.Filter.DatabaseSpecificCreator = new SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator();
            lblFilter.Text = _searcher.Filter.ToQueryText(ref i);
        }
    }  

any ideas?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Feb-2008 04:03:59   

Message="Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt."

Translation? Let me guess: "Object reference not set to an instance of an object." simple_smile

Please check out this thread: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=1159&StartAtMessage=0&#6366

Also, Is the error happening always or only for certain predicates?

David Elizondo | LLBLGen Support Team