Win XP(x86)操作系统上的二级属性绑定异常,但不是Win 7(x64)

时间:2012-07-02 20:04:45

标签: c# .net winforms data-binding

我很难过。我的c#AddressForm

上有以下行

lkuCounty.DataBindings.Add("EditValue", Address, "County.CountyID", true);

这在64位Win7机箱上运行良好,但在Win XP 32位机器上,我得到以下例外:

Type:        System.ArgumentException    
Message:     Cannot bind to the property or column CountyID on the DataSource.    
Parameter name: dataMember

我猜我错过了一些细微差别,非常感谢你的帮助。

以下是我的类(没有构造函数),它们位于一个单独的项目中( myproject.Common

public class County 
{ 
    public short? CountyID { get; set; } 

    public string CountyName { get; set; } 
}
public class Address 
{ 
    public int AddressID { get; set; } 

    public string AddressLine1 { get; set; } 

    public string AddressLine2 { get; set; } 

    public string AddressLine3 { get; set; } 

    public string City { get; set; } 

    public string Zip { get; set; }

    public County County { get; set; } 
} 

1 个答案:

答案 0 :(得分:0)

检查拼写,例如大/小写

相关问题