D
David
I cannot get my aspx page (ASP.Net 2.0) to remove the FilterExpression on a
SqlDataSource. Can someone tell me what I am doing wrong? Below is the
SelectCommand:
<asp:SqlDataSource ID="SqlClosedReason" runat="server" ConnectionString="<%$
ConnectionStrings:WcccuConnectionString %>"
SelectCommand="SELECT NULL As seq_nbr, '-none-' As reason, 1 As active UNION
SELECT [seq_nbr], [reason], [active] FROM [activity_closed_reasons]"
FilterExpression = "active={0}">
<FilterParameters>
<asp:ControlParameter ControlID="txtActive" PropertyName="Text"
Name="pactive" DefaultValue="1" Type="Byte" />
</FilterParameters>
</asp:SqlDataSource>
In my VB code at the top of the page I am doing the following:
SqlClosedReason.FilterExpression = ""
When the page tries to open for a specific record, it gives me the following
error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control.
If I comment out the setting of the FilterExpression the error goes away.
p.s. This is populating a DropDownList.
David
SqlDataSource. Can someone tell me what I am doing wrong? Below is the
SelectCommand:
<asp:SqlDataSource ID="SqlClosedReason" runat="server" ConnectionString="<%$
ConnectionStrings:WcccuConnectionString %>"
SelectCommand="SELECT NULL As seq_nbr, '-none-' As reason, 1 As active UNION
SELECT [seq_nbr], [reason], [active] FROM [activity_closed_reasons]"
FilterExpression = "active={0}">
<FilterParameters>
<asp:ControlParameter ControlID="txtActive" PropertyName="Text"
Name="pactive" DefaultValue="1" Type="Byte" />
</FilterParameters>
</asp:SqlDataSource>
In my VB code at the top of the page I am doing the following:
SqlClosedReason.FilterExpression = ""
When the page tries to open for a specific record, it gives me the following
error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in
the context of a databound control.
If I comment out the setting of the FilterExpression the error goes away.
p.s. This is populating a DropDownList.
David