//根据ParentId及CatenaId查询符合条件的商品列表
public static List<Garefu_Product> GetGarefu_ProductsByCatenaId(int catenaId)
{ string sql = "SELECT Pro_Id, PictureMin,Name,Keywords FROM garefu_Products WHERE CatenaId=@CatenaId"; List<Garefu_Product> list = new List<Garefu_Product>(); try
{
DataTable table = DBHelper.GetDataSet(sql);
// if (table == null) return list;
foreach (DataRow row in table.Rows)
{
Garefu_Product garefu_Product = new Garefu_Product(); garefu_Product.Pro_Id = (int)row["Pro_Id"];
garefu_Product.PictureMin = (string)row["PictureMin"];
garefu_Product.Name = (string)row["Name"];
garefu_Product.Keywords = (string)row["Keywords"]; list.Add(garefu_Product);
}
return list;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
throw e;
}
}最后显示“0”附近有语法错误
public static List<Garefu_Product> GetGarefu_ProductsByCatenaId(int catenaId)
{ string sql = "SELECT Pro_Id, PictureMin,Name,Keywords FROM garefu_Products WHERE CatenaId=@CatenaId"; List<Garefu_Product> list = new List<Garefu_Product>(); try
{
DataTable table = DBHelper.GetDataSet(sql);
// if (table == null) return list;
foreach (DataRow row in table.Rows)
{
Garefu_Product garefu_Product = new Garefu_Product(); garefu_Product.Pro_Id = (int)row["Pro_Id"];
garefu_Product.PictureMin = (string)row["PictureMin"];
garefu_Product.Name = (string)row["Name"];
garefu_Product.Keywords = (string)row["Keywords"]; list.Add(garefu_Product);
}
return list;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
throw e;
}
}最后显示“0”附近有语法错误
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货