0

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!

abatishchev
  • 98,240
  • 88
  • 296
  • 433
ebcrypto
  • 610
  • 1
  • 14
  • 28

1 Answers1

2

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

rkw
  • 7,287
  • 4
  • 26
  • 39
  • I want to do the opposite Contains statement. Never mind, I gave up on the LinqDataSource and now uses an Object which does the underlying Linq query. I find the syntax easier – ebcrypto Aug 01 '11 at 17:14
  • 1
    I hear you on that. Just remember you also have the option of setting the selecting_event on the linqdatasource. – rkw Aug 01 '11 at 20:43