开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜