[thelist] ASP.NET 2.0 QueryStringParameter DefaultValue

Rob Smith rob.smith at lexjet.com
Tue Dec 20 13:22:51 CST 2005


Hey,

 

For the life of me I cannot get the answer to do a wildcard in ASP.NET
2.0:

 

        <asp:GridView>

...

<asp:HyperLinkField DataTextField="Customer"
DataNavigateUrlFields="Customer" NavigateUrl="Default.aspx"
DataNavigateUrlFormatString="Default.aspx?Customer={0}"
HeaderText="Customer" SortExpression="Customer" />

...

        </asp:GridView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CommerceSQLConnectionString3 %>"

            SelectCommand="SELECT ... Company like '@Customer' ">

            <SelectParameters>

              <asp:QueryStringParameter DefaultValue="%"
ConvertEmptyStringToNull="true" Name="Customer"
QueryStringField="Customer" Type="object" />

            </SelectParameters>

         </asp:SqlDataSource>

 

This doesn't return anything when it should. Basically, I want the
entire recordset to show up initially, but someone clicks the link in
the GridView, the query is supposed to fine tune the results to that
specific Customer.

 

Thanks for anyhelp,


Rob Smith
LexJet
rob.smith at lexjet.com
http://www.lexjet.com
(800)453-9538
(941)330-1210 Int'l
(941)330-1220 Fax
1680 Fruitville Road, 3rd Floor
Sarasota, FL 34236

Proud Sponsors of the Professional Digital Imaging Association (www.pdia.org)





More information about the thelist mailing list