SubSonic Forums
All Your Database Are Belong To Us

Scaffold WhereExpression not filtering results

Latest post 12-03-2008 4:28 PM by Devlins. 8 replies.
  • 06-21-2008 3:50 PM

    Scaffold WhereExpression not filtering results

    Hi All,

    I have attempted to filter my scaffold as shown below with no luck.

    <subsonic:Scaffold ID="MyScaffold"
                       runat="server"
                       TableName="MyTable"
                       WhereExpression="Status=0"
                       />

    The result allways returns all records from the table. Any suggestions, or is this a bug?

     

  • 06-22-2008 10:33 PM In reply to

    Re: Scaffold WhereExpression not filtering results

    Reply |Contact |Answer

    Try adding the wheres to the WhereCollection using Code.

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 06-23-2008 3:13 PM In reply to

    Re: Scaffold WhereExpression not filtering results

    I think Eric fixed this for 2.1

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!

  • 07-17-2008 1:20 AM In reply to

    Re: Scaffold WhereExpression not filtering results

    can you give us example on adding wheres in wherecollection?

     

     

  • 09-30-2008 11:00 PM In reply to

    Re: Scaffold WhereExpression not filtering results

    Hi I'm Having the same problem, And I'm using the 2.1.0.0 version.

    Does any one has any idea? Thanks

  • 10-31-2008 1:27 PM In reply to

    • stref
    • Top 500 Contributor
    • Joined on 06-23-2008
    • Posts 8

    Re: Scaffold WhereExpression not filtering results

    Fwiw, I just reconciled (Oct 10, '08) and this is still an issue.

  • 10-31-2008 7:44 PM In reply to

    • ranomore
    • Top 10 Contributor
    • Joined on 11-05-2007
    • Salt Lake City
    • Posts 318

    Re: Scaffold WhereExpression not filtering results

    The scaffold calls the ExecuteJoinedDataset() method. It's hard to debug this because it's all encapsulated in subsonic, but from what I can tell, it's either a provider specific issue in GenerateWheres(), or it's the fact that parameters are never added to the QueryCommand object because the lines that do that are commented out in the ExecuteJoinedDataset() method of SqlQuery.cs.

    So, first off, what provider are you using?

     

     

     

  • 12-03-2008 1:38 PM In reply to

    • jeimer
    • Not Ranked
    • Joined on 12-03-2008
    • Posts 2

    Re: Scaffold WhereExpression not filtering results

    Has there been any solution for this issue? I'm not able to filter my scaffold at all using WhereExpression in the mark up or the code behind. Any suggestions?

  • 12-03-2008 4:28 PM In reply to

    Re: Scaffold WhereExpression not filtering results

    Reply |Contact |Answer

    In the end I ended up setting the WhereCollection in code behind:



    myQuickTable.WhereCollection = null;

    SubSonic.Where where = new SubSonic.Where();
    where.ColumnName = myTable.Columns.myColumnName;
    where.ParameterValue = paramValue;

    List<Where> whereList = new List<Where>();
    whereList.Add(where);

    myQuickTable.WhereCollection = whereList;

     

    hope that helps.

     

     

Page 1 of 1 (9 items) | RSS