1
我有soulation。我想使导航栏中的项目,我会选择他们作为(类别,产品,....)所以我做了存储,让他们通过参数将通过它,s值从查询字符串为 as。导航栏从数据库
ALTER Proc Navcategory
(
@Category_Id Int
)
As
Select Distinct Categories.Category,Categories.Category_Id
From Categories
Where [email protected]_Id
和i的CS 提到
if (Request.QueryString["Category_Id"] != null)
{
Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + "";
using
(SqlConnection conn = Connection.GetConnection())
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Navcategory";
cmd.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"]));
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
LblNavigaton.Visible = true;
LblNavigaton.Text = dr["Category"].ToString();
}
}
}
所以结果将是离。 冰箱>(分类querstring(CATEGORY_ID)时)(查询字符串时,产品展示(产品)) 4Door>
但我想要的结果 冰箱> 4Door> ...> ....
我建议你尝试重新排列你的问题,这样人们可以更容易地阅读。 – 2010-04-07 13:26:17