Author: saburius | Posted on: 7/22/2009 5:13:29 PM | Views : 1091

Hello, I have the following syntax to record recently viewed productIDs in session:
int productID = Convert.ToInt32(Request.QueryString["pid"]); if (Session["rvp"] == null) { Session["rvp"] = productID; } else { Session["rvp"] = Session["rvp"] + "," + productID; }

Unfortunatelly I end up with a string this way. So, when trying to retrieve products base on the IDs in session I get an error saying error converting nvarchar to int.
How can I rewrite the above statement to work with sql? Here is the sql I'm using:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:dbWSATConnectionString %>" SelectCommand="SELECT ProductID, ProductName, ImageDisplay FRO ...

Go to the complete details ...