我目前正在支持我正在嘗試遷移到另一個域的舊 vb.net 應用程式。在舊域上運行時,它可以完美運行,但是在新域中運行 .exe 時會彈出此錯誤:
System.ArgumentException:您必須指定一個有效的謂詞來過濾結果。引數名稱: C:\Users\username\Desktop\CBVS 中 COOP_Incentive.frmEmployeeMaster.LoadDefaultData() System.Data.Objects.ObjectQuery`1.Where(String predicate, ObjectParameter[] parameters) 的謂詞對于 new_domain\COOP Incentive\ Forms\Setup - Employee Master\frmEmployeeMaster.vb:
C:\Users\username\Desktop\CBVS 中 COOP_Incentive.frmEmployeeMaster.frmEmployeeMaster_Load(Object sender, EventArgs e) 的第 78 行 For new_domain\COOP Incentive\Forms\Setup - Employee Master\ frmEmployeeMaster.vb:System.Windows.Forms.Form.OnLoad(EventArgs e)處的第 329 行 System.Windows.Forms.Control.CreateControl(布爾 fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl() 在 System.Windows.Forms.Control.SetVisibleCore(Boolean value) 在 System.Windows.Forms.Form.SetVisibleCore(Boolean value) 在 WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetVisible () 在 WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent 值) 在 WeifenLuo.WinFormsUI.Docking.DockContentHandler.Activate() 在 WeifenLuo.WinFormsUI.Docking.DockContentHandler.Show(DockPanel dockPanel, DockState dockState) 在 COOP_Incentive.frmEmployeeMaster。 Show(DockPanel dockpanel) in C:\Users\username\Desktop\CBVS For new_domain\COOP Incentive\Forms\Setup - Employee Master\frmEmployeeMaster.vb:C 中 COOP_Incentive.frmMenu.cmdEmployeeMaster_Click(Object sender, EventArgs e) 的第 356 行:\Users\username\Desktop\CBVS 對于 new_domain\COOP Incentive\Forms\MainForms\frmMenu.vb:System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 處 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 處 System.Windows.Forms.Control.OnClick(EventArgs e) 的第 26 行在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.Control .ControlNativeWindow.WndProc(訊息& m)WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)
根據錯誤訊息,這是它所指的代碼:
cboBusinessUnit.DataSource = (From r In DefaultBusinessUnitSet.Where(filter).Execute(MergeOption.PreserveChanges) _
Order By r.BussinessCode _
Select New With {.id = r.BussinessCode, .text = r.BussinessName}).ToList()
這是“Where”部分中的過濾器變數:
Dim filter As String = String.Join(" or ", (From result In SessionUtil.AllowedEmployerCodes _
Let c = " it.BussinessCode='" result "' " _
Select c).ToArray())
我不熟悉這種錯誤,我該如何解決這個問題?
uj5u.com熱心網友回復:
過濾器字串很可能與一些使其無效的東西一起著陸。我建議您在拋出錯誤時顯示過濾器值。例如,您的雇主代碼中可能有一個撇號。在這種情況下,您需要用替換來包裝結果,例如replace(result,"'","''")。
uj5u.com熱心網友回復:
檢查過濾器變數時,它沒有反映任何資料。我需要檢查 SessionUtil.AllowedEmployerCodes 的所有參考,并發現在登錄期間,它將基于您的 SID。我忽略了一張表,我應該將我的 SID 從舊域更新到新域。它成功了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/442651.html
上一篇:無需通過Selenium即可導航MicrosoftEdge的UI自動化?
下一篇:熊貓資料框到excel
