0

我遇到了无法调试的问题。

我有一个表单,当我按下一个按钮时,它会打开另一个表单,如下所示:

wfrmBkrShotefHitpalgutNechasim_Perut.Close()
wfrmBkrShotefHitpalgutNechasim_Perut.Text = pPageHeader
wfrmBkrShotefHitpalgutNechasim_Perut.kerenGUID = KodKeren
wfrmBkrShotefHitpalgutNechasim_Perut.TaarichNechonut = Taarich
wfrmBkrShotefHitpalgutNechasim_Perut.SugHitpalgut = MisHitpalgut
wfrmBkrShotefHitpalgutNechasim_Perut.KodKvutzatHitpalgut = cm.Current("Kod").ToString
wfrmBkrShotefHitpalgutNechasim_Perut.MdiParent = Me.MdiParent
wfrmBkrShotefHitpalgutNechasim_Perut.Show()

它正确地完成新表单的所有加载,并在完成后执行 Show 如果失败。

我得到的消息异常是:项目已添加。字典中的键:'kod' 正在添加的键:'kod'

我不知道它在谈论哪个列表/字典,我查看了异常的详细信息,我看到了这个:

**System.ArgumentException =** {"Item has already been added. Key in dictionary: 'kod'  Key being added: 'kod'"}

**Data =** {System.Collections.ListDictionaryInternal} 

**Values =**  {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}

**Keys =** {System.Collections.ListDictionaryInternal.NodeKeyValueCollection}

**Source:** "mscorlib"

**StackTrace =**    at System.Collections.SortedList.Add(Object key, Object value)    at
Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptorCollection.EnsureSortedList()
at
Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptorCollection.Find(String
name)    at
Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptorCollection.get_Item(String
name)    at
Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.EnsureRecordRowColumns()
at
Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.get_RecordRowColumns()
at
Syncfusion.Windows.Forms.Grid.Grouping.GridTableDescriptor.GetColumnSetColCount()
at
Syncfusion.Windows.Forms.Grid.Grouping.GridTableModelVolatileData.get_ColCount()
at Syncfusion.Windows.Forms.Grid.GridModel.get_ColCount()    at
Syncfusion.Windows.Forms.Grid.GridScroll.GetMaxColScrollPosition()   
at
Syncfusion.Windows.Forms.Grid.GridScroll.ColIndexToScrollPosition(Int32
colIndex)    at
Syncfusion.Windows.Forms.Grid.GridScroll.GetNextColIndex(Int32&
colIndex, Boolean skipFirstHidden)    at
Syncfusion.Windows.Forms.Grid.GridScroll.GetNextColIndex(Int32
colIndex, Boolean skipFirstHidden)    at
Syncfusion.Windows.Forms.Grid.GridControlBase.GetFirstScrollableCol()
at Syncfusion.Windows.Forms.Grid.GridControlBase.Initialize()    at
Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.Initialize() 
at
Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.OptimizeLoadTime()
at
Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.f_Load(Object
sender, EventArgs e)    at System.EventHandler.Invoke(Object sender,
EventArgs e)    at System.Windows.Forms.Form.OnLoad(EventArgs e)   
at System.Windows.Forms.Form.OnCreateControl()    at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)   
at System.Windows.Forms.Control.CreateControl()    at
System.Windows.Forms.Control.WmShowWindow(Message& m)    at
System.Windows.Forms.Control.WndProc(Message& m)    at
System.Windows.Forms.ScrollableControl.WndProc(Message& m)    at
System.Windows.Forms.ContainerControl.WndProc(Message& m)    at
System.Windows.Forms.Form.WmShowWindow(Message& m)    at
System.Windows.Forms.Form.WndProc(Message& m)    at
Syncfusion.Windows.Forms.Office2007Form.WndProc(Message& m)    at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
m)    at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)    at
System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)    at
System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style,
Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent,
HandleRef hMenu, HandleRef hInst, Object pvParam)    at
System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)    at
System.Windows.Forms.Control.CreateHandle()    at
System.Windows.Forms.Form.CreateHandle()    at
System.Windows.Forms.Control.get_Handle()    at
System.Windows.Forms.Form.SetVisibleCore(Boolean value)    at
System.Windows.Forms.Control.Show()    at
Elad.BakaratNeemanut.UI.wfrmBkrShotefHitpalgutNechasim.btnPerut_Click(Object
sender, EventArgs e) in
C:\WorkingFolder\NeemanutRoot\NeemanutWcfTest\UI\BakarotShotfot\wfrmBkrShotefHitpalgutNechasim.vb:line
242

**IsVurtual =** true

**FullQualifieldName** = "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"

**Module =** {System.Reflection.Module}

有什么建议如何找到错误并修复它?

4

1 回答 1

0

好的人们不要担心,

在新表格中,我填写了一个网格,其中有 2 列同名:“kod”

所以这就是问题所在。

不管怎么说,还是要谢谢你。此致!

于 2013-07-22T08:25:20.257 回答