误差的一个实例在InfoPath:C#对象引用不设置为一个对象
对象引用不设置为一个对象的一个实例。 在InfoPathFormTemplate5.FormCode.CTRL407_5_Clicked(对象发件人,ClickedEventArgs E) 在Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent) 在Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
VB2005中的错误:未将对象引用设置为对象的实例。 System.NullReferenceException未被用户代码处理 Message =“未将对象引用设置为对象的实例。” 源= “InfoPathFormTemplate5” 堆栈跟踪: 在InfoPathFormTemplate5.FormCode.CTRL407_5_Clicked(对象发件人,ClickedEventArgs e)如C:\ Documents和Settings \ pebabczu \桌面\ IntakeForm复印\ InfoPathFormTemplate5 \ FormCode.cs:线206 在微软。 Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent) 在Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
代码:
string TeamL = xnMyForm.SelectSingleNode("/my:myFields/my:field149", ns).Value;
string ACC = xnMyForm.SelectSingleNode("/my:myFields/my:Bank", ns).Value;
string remarkmain = xnMyForm.SelectSingleNode("/my:myFields/my:field104", ns).Value;
string RemarkHR = xnMyForm.SelectSingleNode("/my:myFields/my:Remarks1", ns).Value;
string RemarkTL = xnMyForm.SelectSingleNode("/my:myFields/my:field55", ns).Value;
string RemarkIT = xnMyForm.SelectSingleNode("/my:myFields/my:RemarksICT", ns).Value;
string Rmain = "Remarks: " + remarkmain;
string RHR = "Remarks: " + RemarkHR;
string RTL = "Remarks: " + RemarkTL;
string RIT = "Remarks: " + RemarkIT;
我没有得到它......只是进入C#我做错了什么。?
哪条线是#206? – 2011-05-24 14:16:41
字符串RemarkIT = xnMyForm。SelectSingleNode(“/ my:myFields/my:RemarksICT”,ns).Value; – Euronymus 2011-05-24 15:11:08
肯定是一个返回null不知道为什么......虽然检查所有其他 – Euronymus 2011-05-24 15:11:48