0

グローバル s が static int である次のコードを実行すると、このエラーが発生します。かなりの数の記事を見てきましたが、どこが間違っているのかわかりません。

例外の詳細: System.Data.SqlClient.SqlException: nvarchar 値 'glb.catID' をデータ型 int に変換するときに変換に失敗しました。

<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
4

0 に答える 0