ebcrypto
ebcrypto

Reputation: 610

LinqDataSource Where Parameter

I have the below query on my aspx page that works:

<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
    ContextTypeName="InventoryDataContext" 
    EntityTypeName="" TableName="V_InventoryForDisplays" 
    Where="ConfiguredCarId == @ConfiguredCarId">
    <WhereParameters>
        <asp:Parameter DefaultValue="2827" Name="ConfiguredCarId" Type="Int32" />
    </WhereParameters>
</asp:LinqDataSource>

I need to change the Where clause to use a Contains statement. I have an auto-propertyЖ

public IEnumerable<int> ConfiguredCarIds { get; set; }

within the same class that I would like to use

so what is the proper syntax to do this:

Where="ConfiguredCarIds.Contains (ConfiguredCarId)"

Thanks!

Upvotes: 0

Views: 2786

Answers (1)

rkw
rkw

Reputation: 7297

Try Where="ConfiguredCarId.Contains(@ConfiguredCarId)"

Upvotes: 2

Related Questions