誤差的一個實例在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