二级物业在Win XP(x86)的操作系统绑定异常,但没有赢得7(64)绑定、异常、操作系统、物业

2023-09-04 11:21:38 作者:北海旧梦碎人心

我难倒。我有我的C#为AddressForm以下行

lkuCounty.DataBindings.Add(的EditValue,地址County.CountyID,真);

这在64位Win7的箱子,但在Win XP 32位机的伟大工程,我得到以下异常:

 键入信息:System.ArgumentException
消息:无法绑定到数据源的属性或列CountyID。
参数名称:数据成员
 

我猜我缺少一些细微差别,并会真的AP preciate一些帮助。

win7 xp双系统启动项没有xp了怎么办

下面是我的课(无构造函数),这是在一个单独的项目( myproject.Common 的)

 公共类县
{
    公共短? CountyID {获得;组; }

    公共字符串CountyName {获得;组; }
}
公共类地址
{
    公众诠释AddressID {获得;组; }

    公共字符串AddressLine1 {获得;组; }

    公共字符串AddressLine2 {获得;组; }

    公共字符串AddressLine3 {获得;组; }

    公共字符串市{获得;组; }

    公共字符串邮编{获得;组; }

    公共县县{获得;组; }
}
 

解决方案

检查拼写,例如大/小写

I am stumped. I have the following line on my c# AddressForm

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

This works great on 64bit Win7 boxes but on Win XP 32bit machines I get the following Exception:

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

I am guessing I am missing some nuance and would really appreciate some help.

Here are my classes(no constructors) which are in a seperate project (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; } 
} 

解决方案

check spell e.g. upper/lower case