c# - Win XP(x86) OS 但不是 Win 7(x64) 上的二级属性绑定(bind)异常

标签 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; } 
} 

最佳答案

检查拼写,例如大写/小写

关于c# - Win XP(x86) OS 但不是 Win 7(x64) 上的二级属性绑定(bind)异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11300414/

相关文章:

c# - 从 Linq 查询异常中抛出异常

c# - HttpWebRequest 因异步和等待而随机失败

c# - Sum List<T> List<T> 中每一项的属性

c# - 继承的 Windows 窗体奇怪行为

c# - 验证在窗口窗体的文本框中只有数字数据

c# - 在 ASP.NET 2.0 Web 服务中公开其他类

c# - 通过列表和数组中的索引获取结构项

c# - 将 JSON.Net 用于 BSON 和 JSON 的最简单方法?

c# - xmlns ='' > 不是预期的。 - XML 文档中存在错误 (2, 2)

c# - 使用devexpress的饼图,从变量传递值