【发布时间】:2015-01-19 13:59:06
【问题描述】:
我尝试了这个例子,但没有用。
<%string id = Request.QueryString["id"]; %>// get value and set in one variable
<%=id%>// display successfully variable's value
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [id], [name], [image], [old_price], [new_price] FROM [product] where [id]= "'<%=id%>'"" ></asp:SqlDataSource>
SelectCommand 中的问题如何在查询中设置变量我尝试像
【问题讨论】:
-
SelectCommand 中的问题如何在查询中设置变量我尝试像 。
-
我强烈建议您不要将应用的表示层与数据层混为一谈。有很多原因。其中,安全、逻辑解耦、维护。请不要那样做。有关 SelectCommand 的更多详细信息,请查看here。
-
此链接可能对您有所帮助..stackoverflow.com/questions/3319358/…
-
我没有在 gridview 中显示数据库。在普通的 html 表中。