Datasource Filters a little bit confusing

I used filtering one or two times with datasource controls. Now i am developing a ASP.NET sample application with pretty new 2.0 bits. Should be nearly B2.

If you load the whole data you can filter the view of data without additional sql server roundtrips.

The basics of filtering works nearly as the method with SelectParameters. In B1 it was the same. Now is a small but import diffrence. The Parameter is not named like a SQL Parameter @name. The concept is now like the format Strings with {0}.

<asp:AccessDataSource ID="AccessDataSource1" runat="server"

DataFile="~/App_Data/event.mdb"

SelectCommand="SELECT * FROM [Timing]"

CacheDuration="600" EnableCaching="True"

FilterExpression="tag = {0} and startzeit='{1}'"

>

<FilterParameters >

<asp:ControlParameter ControlID="txtDate" PropertyName ="Value" Name="filterdatum" />

<asp:ControlParameter ControlID="txtZeit" PropertyName ="Value" Name="filterzeit" />

</FilterParameters>

</asp:AccessDataSource>

Took me 3 hour to figure it out.

Published Monday, January 17, 2005 8:59 PM by preishuber

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)