Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Using SelectParameter
 

Pages: 1
Bugs & Issues
Using SelectParameter
Page:1/1 

  Print all messages in this thread  
Poster Message
Gayane
User



Location:

Joined on:
14-Apr-2008 06:33:16
Posted:
10 posts
# Posted on: 30-Sep-2008 10:29:41.  
I have datasource, but i dont want it to return all rows from db. I added select parameter and connected it to session field and i supposed to get only the rows which fields are equal to session field, but i got all rows. How I must use SelectParameter to to my task ?

Thanks in advance.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 30-Sep-2008 11:25:22.  
Would you please post a code snippet of the aspx declaration of the datasource with the SelectParameters?

  Top
Gayane
User



Location:

Joined on:
14-Apr-2008 06:33:16
Posted:
10 posts
# Posted on: 30-Sep-2008 12:21:48.  
Here is my code
Code:

<llblgenpro:LLBLGenProDataSource ID="shipperDS" runat="server"
                 DataContainerType="EntityCollection" EntityCollectionTypeName="ElectronicBorder.CollectionClasses.EbShipperConsigneeCollection, ElectronicBorder">
                        <SelectParameters>
                            <asp:SessionParameter DefaultValue="1" Name="CompanyInfoId"
                                SessionField="companyid" Type="Int32" />
                        </SelectParameters>
                    </llblgenpro:LLBLGenProDataSource>
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 30-Sep-2008 13:20:16.  
I can't reproduce it, the following works very well with me without writing a single line of code, all done at Design-Time.

Code:
        Test Session Parameters<br />
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductId" DataSourceID="LLBLGenProDataSource2">
            <Columns>
                <asp:BoundField DataField="ProductId" HeaderText="ProductId" InsertVisible="False"
                    ReadOnly="True" SortExpression="ProductId" />
                <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
                <asp:BoundField DataField="SupplierId" HeaderText="SupplierId" SortExpression="SupplierId" />
                <asp:BoundField DataField="CategoryId" HeaderText="CategoryId" SortExpression="CategoryId" />
                <asp:BoundField DataField="QuantityPerUnit" HeaderText="QuantityPerUnit" SortExpression="QuantityPerUnit" />
                <asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" />
                <asp:BoundField DataField="UnitsInStock" HeaderText="UnitsInStock" SortExpression="UnitsInStock" />
                <asp:BoundField DataField="UnitsOnOrder" HeaderText="UnitsOnOrder" SortExpression="UnitsOnOrder" />
                <asp:BoundField DataField="ReorderLevel" HeaderText="ReorderLevel" SortExpression="ReorderLevel" />
                <asp:CheckBoxField DataField="Discontinued" HeaderText="Discontinued" SortExpression="Discontinued" />
            </Columns>
        </asp:GridView>
        <llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource2" runat="server"
            EnablePaging="True" DataContainerType="EntityCollection" EntityCollectionTypeName="Norhthwind.CollectionClasses.ProductsCollection, Norhthwind">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="1" Name="CategoryId" SessionField="CatId" />
            </SelectParameters>
        </llblgenpro:LLBLGenProDataSource>        


Are you sure the EbShipperConsigneeEntity has a CompanyInfoId field? (check the spelling)
Which version of LLBLGen Pro runtime library are you using?


  Top
Gayane
User



Location:

Joined on:
14-Apr-2008 06:33:16
Posted:
10 posts
# Posted on: 30-Sep-2008 14:56:48.  
The only difference is that i dont have that field in the grid. When i add the field to grid it works.

Thanks.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 30-Sep-2008 16:26:24.  
Strange, coz when I remove the CategoryId from the Grid the SelectParameters still works fine.

For this repro I used the latest release of v.2.5 & V.S.2005 (Selfservicing Template Set)


  Top
JimHugh
User



Location:
Davis, CA
Joined on:
16-Nov-2005 14:32:25
Posted:
191 posts
# Posted on: 01-Oct-2008 08:06:31.  
Check the casing of the parameter names. e.g CompanyId and companyid will refer to different values even with a case insenitive database.
Jim Hughes  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.