If you don't know the number of params at design time, and can only determine at runtime, consider changing the Where
property of the datasource at runtime. You can insert actual values yourself.
//e.g. we know that we want 4 params this time.
LinqDataSource1.Where =
"Alpha == 1 OR Brave==False OR Charlie> 'Jan 1 1999' or Delta = @DeltaVal";
LinqDataSource1.WhereParameters.Add("DeltaVal", "O'Flanagan");
If you do know the n params at runtime, you could simply put the OR statement at design-time, and modify their values.
Perhaps put your OR
clause right in the LinqDataSource declaration.
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
Where="Foo == @FooValue OR Bar==@BarValue">
Then you code-behind can add those two where
parameters.
LinqDataSource1.WhereParameters.Add("FooValue", "milk");
LinqDataSource1.WhereParameters.Add("BarValue", "eggs");