开发者

QueryStringParameter does not binds

开发者 https://www.devze.com 2023-03-24 21:21 出处:网络
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.

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

精彩评论

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