C#: невозможно привязать к свойству или имени столбца в DataSource - PullRequest
0 голосов
/ 04 августа 2020

введите описание изображения здесь

Я получаю это сообщение об ошибке при запуске приложения C# Winforms. Это началось совсем недавно, и я не могу точно определить, какое изменение вызвало его появление. Может ли кто-нибудь предложить, где я должен исследовать дальше?

Подробности исключения показаны здесь: Тип: System.ArgumentException Данные: {System.Collections.ListDictionaryInternal} Результат: -2147024809 Сообщение: Cannot bind to the property or column Name on the DataSource. Parameter name: dataMember ParamName: "dataMember" Источник: "System.Windows.Forms" Трассировка стека:

at System.Windows.Forms.BindToObject.CheckBinding()
at System.Windows.Forms.BindToObject.SetBindingManagerBase(BindingManagerBase lManager)
at System.Windows.Forms.Binding.SetListManager(BindingManagerBase bindingManagerBase)
at System.Windows.Forms.ListManagerBindingsCollection.AddCore(Binding dataBinding)
at System.Windows.Forms.BindingsCollection.Add(Binding binding)
at System.Windows.Forms.BindingContext.UpdateBinding(BindingContext newBindingContext, Binding binding)
at System.Windows.Forms.Control.UpdateBindings()
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.TabPage.set_Visible(Boolean value)
at System.Windows.Forms.TabControl.UpdateTabSelection(Boolean updateFocus)
at System.Windows.Forms.TabControl.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TabControl.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)

Кроме того, в деталях целевого сайта я обнаружил следующие ошибки:

Method System.Reflection.RuntimeMethodInfo.get_IsSecurityCritical cannot be called in this context. Method System.Reflection.RuntimeMethodInfo.get_IsSecuritySafeCritical cannot be called in this context. Method System.Reflection.RuntimeMethodInfo.get_IsSecurityTransparent cannot be called in this context. Method System.Reflection.MethodBase.get_MethodImplementationFlags cannot be called in this context. '((System.Reflection.RuntimeMethodInfo)($exception).TargetSite).ReflectedType' threw an exception of type 'System.NotSupportedException' Method System.Reflection.RuntimeMethodInfo.get_ReturnTypeCustomAttributes cannot be called in this context.

...