我有一个静态类和只读属性未将对象引用设置为对象的实例。 C#.NET
public class ClaSearchUser
{
public ClaSearchUser() { }
public struct Attributes
{
public static readonly Attribute EMAIL_ADRESS;
public static readonly Attribute FIRST_NAME;
public static readonly PuzzleAttribute STATUS;
}
}
但是,当我做它用,我得到的电子邮件行错误。
foreach (DataRow mRow in data.Table.Rows)
{
String id = mRow[AttributeManager.Common.Ident.Name].ToString();
String user_oid = mRow[AttributeManager.Common.Oid.Name].ToString();
String email = mRow[ClaSearchUser.Attributes.EMAIL_ADRESS.Name].ToString();
}
在此先感谢
在哪一行发生错误? – jAC
你的其中一个变量为空,就是错误说的。请放置一个断点并遍历代码;我们不能为你做到这一点。 – CodeCaster