View Full Version : sqldatasource not running query

07-08-2010, 10:17 AM
<asp:SqlDataSource ID="SqlDataSource1" runat="server"ConnectionString="<%$ ConnectionStrings:ABCConnectionString %>"

SelectCommand="SELECT * FROM [Data] WHERE ([ActivityName] IN (@ActivityName)) AND ([ID] = @ID)" >

<asp:ControlParameter ControlID="DropDownList_ID" Name="ID"
PropertyName="SelectedValue" Type="Int32" />

<asp:ControlParameter ControlID="LabelHidden" Name="ActivityName"
Type="String" />


The variable 'LabelHidden' contains a string of values: "'Production Technical Support', 'Tools Development'"

Manually, the sql query would run like this, for example:

SELECT * FROM [Data] WHERE ([ActivityName] IN ('PT Support', 'Tools Development')) AND ([ID] = 4)

It runs correctly when I use this query in SQL Management Studio, but will not run correctly from within my

Have you any advice or alternative suggestions?

I also tried with an event handler and OnSelecting, but got the same blank result.