dimanche 19 avril 2015

Asp QueryStringParameter Conversion failed when converting the nvarchar

I get this error when I run the following code the global s are static int, I have looked at quite a few articles but cannot see where this is going wrong:



Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the nvarchar value 'glb.catID' to data type 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

Aucun commentaire:

Enregistrer un commentaire