您应该
ToString()以所需的格式为您的班级改写,例如:
public class SharePrices{ public DateTime theDate { get; set; } public decimal sharePrice { get; set; } public override string ToString() { return String.Format("The Date: {0}; Share Price: {1};", theDate, sharePrice); }}默认情况下,不进行覆盖,
ToString()返回代表当前对象的字符串。这就是为什么您得到您所描述的。



