好急!!!各位朋友,请帮忙解决一下我一直没解决的问题, string sql="select ... where cateBig = '" + ProdBigStr + "'"; 字符串,都要带单引号!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if (ProdBigStr == "--产品大类--"){ ProdBrandAll = "";}else if(ProdLitStr == "--产品小类--"){ ProdBrandAll = "cateBig = '" + ProdBigStr + "'";}else if(ProdBrandStr == "--产品品牌--"){ ProdBrandAll = "cateBig = '" + ProdBigStr + "' and cateLit = '" + ProdLitStr + "'";}else{ ProdBrandAll = "cateBig = '" + ProdBigStr + "' and cateLit = '" + ProdLitStr + "' and brand = '" + ProdBrandStr + "'";}if(ProdBigStr != "--产品大类--"){ StrSql += " where " + ProdBrandAll;} else{ StrSql = "SELECT brand from CompanyProdCate";}记住你一定要记住:字符串拼接后的正确性 Membership令人费解的问题。 |M| 辞职了....高兴。郁闷ing 输入中文,在数据库中为乱码,如何解决? 定议了一个类,出错啊, 我用JMail发邮件怎么老是出现8000ffff错误??这要怎么解决啊?? 关于asp.net 2.0中TreeView 和iFrame 高度关系的问题(高分求解) 菜鸟求一SQL语句 关于asp.net和excle的编程问题 100分收集DataGrid使用技巧[Asp.Net] 想做一个大型BtoB平台,请问用ASP.NET+SQL-SERVER开发是否合适? session超时问题 我想在XP的系统下装ASP.net请问需要在装写什么升级包?
{
ProdBrandAll = "";
}
else if(ProdLitStr == "--产品小类--")
{
ProdBrandAll = "cateBig = '" + ProdBigStr + "'";
}
else if(ProdBrandStr == "--产品品牌--")
{
ProdBrandAll = "cateBig = '" + ProdBigStr + "' and cateLit = '" + ProdLitStr + "'";
}
else
{
ProdBrandAll = "cateBig = '" + ProdBigStr + "' and cateLit = '" + ProdLitStr + "' and brand = '" + ProdBrandStr + "'";
}if(ProdBigStr != "--产品大类--")
{
StrSql += " where " + ProdBrandAll;
}
else
{
StrSql = "SELECT brand from CompanyProdCate";
}记住你一定要记住:字符串拼接后的正确性