当我运行以下代码时,我得到这个错误,全局s是静态int,我看了很多文章,但看不出这出错的地方:
异常详细信息:System.Data.SqlClient.SqlException:Conversion 将nvarchar值'glb.catID'转换为数据类型时失败 中间体
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CommerceConnectionString %>"
SelectCommand="select CategoryID, CategoryName, ProductImage, Title, SubCatID
from Categories
JOIN Products
ON Categories.CategoryID= Products.CatID
WHERE CategoryID = @CategoryID AND SubCatID = @SubCatID ">
<SelectParameters>
<asp:QueryStringParameter Name="CategoryID" QueryStringField="CategoryID" DefaultValue="glb.catID" />
<asp:QueryStringParameter Name="SubCatID" QueryStringField="SubCatID" DefaultValue="glb.subcatID"/>
</SelectParameter