为什么在点击价格范围时却没有显示产品? [英] why while click on price ranges it not shows the products?

查看:64
本文介绍了为什么在点击价格范围时却没有显示产品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮忙.

这是价格范围的编码,但是当单击价格范围时,它不会显示任何产品.

Can anyone help.

This is the coding for price ranges, but when click price range it does not show any products.

protected void BulletedList3_Click(object sender, BulletedListEventArgs e)
  {

     string price = BulletedList3.Items[e.Index].Value;
      if (con.State == ConnectionState.Closed)
      {
          con.Open();
      }
      SqlCommand cmd = new SqlCommand("select pro_img,pro_name,price from product where price='" + price + "' and status='A' and type='retail'", con);
      SqlDataAdapter da = new SqlDataAdapter(cmd);
      DataSet ds = new DataSet();
      da.Fill(ds);
       DataList1.DataSource = ds;
      DataList1.DataBind();
      con.Close();
  }

推荐答案



您想要确切的值吗?
sql中price的数据类型是varchar吗?
您使用=符号表示确切的值将匹配.
如果找不到带有输入价格的记录,则不显示结果


are u want the exact value?
and what is the data type of price in sql is it varchar?
you use = sign that means the exact values will match.
if no records with the input price is found then the result is not shown


这篇关于为什么在点击价格范围时却没有显示产品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆