Forum,
I have a query with a Selectparameter, however my Selectparameter is not always present, and in that case, I would like the query to return all records.
I'm using a column called status for the parameter. Status is an tinyint that IS NOT NULL.
Psuedo code:
<asp:SqlDataSource ID="sqlMy" runat="server" ConnectionString="<%$ ConnectionStrings:myConnStr%>"
SelectCommand="SELECT *, FROM [myTbl] WHERE status = @status">
<SelectParameters>
<asp:QueryStringParameter Name="status" QueryStringField="status" DefaultValue="" />
</SelectParameters>
</asp:SqlDataSource>
Suggestions?
Thank you,
Ray K. Ragan
I have a query with a Selectparameter, however my Selectparameter is not always present, and in that case, I would like the query to return all records.
I'm using a column called status for the parameter. Status is an tinyint that IS NOT NULL.
Psuedo code:
<asp:SqlDataSource ID="sqlMy" runat="server" ConnectionString="<%$ ConnectionStrings:myConnStr%>"
SelectCommand="SELECT *, FROM [myTbl] WHERE status = @status">
<SelectParameters>
<asp:QueryStringParameter Name="status" QueryStringField="status" DefaultValue="" />
</SelectParameters>
</asp:SqlDataSource>
Suggestions?
Thank you,
Ray K. Ragan