QueryStringParameter does not binds
I am tried to bind ID
from HTTP header to a parameter in my select query. It 开发者_如何学Pythonreturns no records as if null is being binded. What could be the issue.
<asp:SqlDataSource ID="sdsCities" runat="server" ConnectionString="<%$ ConnectionStrings:MyConn %>"
SelectCommand="SELECT * FROM [cities] WHERE ([cityid] = @cityid) ORDER BY DateCreated Desc">
<SelectParameters>
<asp:QueryStringParameter Name="cityid" QueryStringField="ID" Type="Int32" DefaultValue="7856"/>
</SelectParameters>
</asp:SqlDataSource>
In the address bar, I have this string
?mode=full&ID=123
Even the Default value does not work. Help will be greatly appreciated.
精彩评论