I am a bit confused on how to do this. I think I would know how to if I did not have auto where clause set to true. I am trying to this :
if ExpirationDateTime < DateTime.Now then IsActive = False.
I am not sure if I need an update parameter to accomplish this? Or do a Where ExpirationDateTime < DateTime.Now? Either way to filter out if it has an expired DateTime. Thanks, Jake
maltesehunte...
Member
79 Points
57 Posts
LinqdataSource Parameter?
Mar 07, 2011 10:18 PM|LINK
I am a bit confused on how to do this. I think I would know how to if I did not have auto where clause set to true. I am trying to this :
if ExpirationDateTime < DateTime.Now then IsActive = False.
I am not sure if I need an update parameter to accomplish this? Or do a Where ExpirationDateTime < DateTime.Now? Either way to filter out if it has an expired DateTime. Thanks, Jake
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="PostPropertyDataContext" EntityTypeName=""
TableName="PropertyInfos" AutoGenerateWhereClause="True" OrderBy="DateTimeNow DESC"
Select="new (ID, AccountInfoGUID, DateTimeNow, IsActive, ExpirationDateTime, City, State, Category, AccountInfo)">
<WhereParameters>
<asp:Parameter DbType="Boolean" DefaultValue="True" Name="IsActive" />
<asp:Parameter DefaultValue="Sacramento" Name="City" Type="String" />
<asp:Parameter DefaultValue="CA" Name="State" Type="String" />
<asp:ControlParameter Name="Category" ControlID="ListView1$categorydropdownlist" Type="String" />
</WhereParameters>
</asp:LinqDataSource>