First i have a problem of getting the ProductIds from main page to Product Catalog.aspx Page through querystring.
Now when i make some Changes in the coding as below. i am getting the ProductsIDs form main page to ProductCatalog.aspx page thorugh querystring.I Used debugger to check that. On main page i made the fallowing changes. now ids are going to productcatalog.aspx page.
string querydr = "select * from Products";
SqlDataReader dr = obj.fillcomb(querydr);
while (dr.Read())
{
if(proid == String.Empty)
{
proid = dr["ProductID"].ToString();
}
else
{
proid += "," + dr["ProductID"].ToString();
}
}
Response.Redirect("ProductCatalog.aspx?ID="+proid);
I used Debugger to check that whats going on on ProductCatalog.aspx Page..
I saw that i am getting the fallowing thing in my query on product catalog.aspx page..
I put the query in productcatalog.aspx page as
string query = "Select * from Products where ProductID= '" + Request.QueryString["ID"].ToString() +"' AND UnitCost < 5000";
and on dubbugger i saw that the query runs as below.
query "Select * from Products where ProductID= ',63,64,65' AND UnitCost < 5000" string
the products with ids have 63 and 64 have price(UnitCost) <5000 but nothing is shown in gridview. can anyone help on that where is the problem
on ProductCatalog.aspx page i have the code as below
private void LoadGridView()
{
if (Request.QueryString["ID"] != null && Request.QueryString["ID"].ToString() != "")
{
string query = "Select * from Products where ProductID= '" + Request.QueryString["ID"].ToString() +"' AND UnitCost < 5000";
DataSet dss = obj.fillgrid(query);
GridView1.DataSource = dss.Tables[0];
GridView1.DataBind();
}
}
i put loadgridview on page load