原谅提出重复的问题,但我找不到答案。 实际上我已经下载了一个项目,当我运行它时会在这一行上出现错误:
BicycleProduct displayDetails = new BicycleProduct(
这是完整的代码:
foreach (DataRowView row in view)
{
BicycleProduct displayDetails = new BicycleProduct(
(string)row["BrandName"],
(string)row["Color"],
(string)row["GridPageImageName"],
(string)row["LinkTitle"],
(decimal)row["ListPrice"],
(string)row["ModelName"],
(decimal)row["MSRP"],
(int)row["PercentSaved"],
(int)row["ProductID"],
(string)row["ProductPageImageName"],
(string)row["ProductGridLinkPage"],
(decimal)row["Savings"],
(string)row["Summary"],
(decimal)row["Weight"]);
list.Add(displayDetails);
}
return list;
}