llblgendatasource - querystring related entity

Posts   
 
    
Posts: 72
Joined: 11-Aug-2006
# Posted on: 11-Aug-2006 01:18:19   

Hi There

trying to do some "quick and dirty" maintenenance screens for list / maintenence using datasource objects.

Typical Customer / orders scenario..

httpdisappointed /localhost/mysite/Orders.aspx?CustomerID=1

I want the select parameter to use the query string entityaID to select only the related entities from the db.

e.g. select * from Orders where CustomerID = 1

Can I do that all with properties? I get an error saying

"A field or property with the name 'CustomerId' was not found on the selected data source."

Of course I could do it in the code behind. What is the fastest way to do this? Can you give an example?

Thanks Martysmile

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Aug-2006 08:16:24   

I think you should use something like:

<SelectParameters>
      <asp:QueryStringParameter Name="CustomerID" Type="string" QueryStringField="CustomerID" />
</SelectParameters>

Just make sure your dataSource already have this field.

Please refer to the LLBLGen Pro Manual "Using the generated code -> Adapter/SelfServicing -> Databinding at design time and runtime-> Databinding with ASP.NET 2.0" check the paragraph "filtering on the fly"