c# - Unable to cast object of type 'System.DBNull' to type 'System.String'. DataRowView -
forgive asking duplicate question, couldn't find answer. i've downloaded project , when run gives error on line:
bicycleproduct displaydetails = new bicycleproduct(
and total code:
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); } homecoming list; } c#
No comments:
Post a Comment