C# System.Core.dll中的NotimplementedException

C# System.Core.dll中的NotimplementedException,c#,winforms,notimplementedexception,C#,Winforms,Notimplementedexception,我的代码中出现以下错误: 在>System.Core.dll中发生类型为“System.NotImplementedException”的未处理异常 附加信息:未实现该方法或操作 当我试图在datagridview上设置数据源时,就会发生这种情况。该错误发生在文本框上的TextChanged事件上,我正在尝试根据输入过滤datagridview 事件中的代码如下所示: IEnumerable<b2bHdr> filteredClaims = claims.Where(

我的代码中出现以下错误:

在>System.Core.dll中发生类型为“System.NotImplementedException”的未处理异常

附加信息:未实现该方法或操作

当我试图在datagridview上设置数据源时,就会发生这种情况。该错误发生在文本框上的TextChanged事件上,我正在尝试根据输入过滤datagridview

事件中的代码如下所示:

        IEnumerable<b2bHdr> filteredClaims = claims.Where(sc => sc.claimNumber.ToString().Contains(ntxtClaimNoSearch.Text));
        dgvHdr.DataSource = filteredClaims;
        dgvHdr.AutoResizeColumns();
        if (filteredClaims.Count() > 0)
        {
            dgvDtl.DataSource = filteredClaims;
            dgvDtl.DataMember = "b2bDetails";
            dgvDtl.AutoResizeColumns();
        }
        else
        {
            dgvDtl.DataSource = null;
        }
[Table(Name = "tbl_B2BHdr")]
public class b2bHdr
{
    private EntitySet<b2bDtl> _b2bDetails;
    public b2bHdr()
    {
        this._b2bDetails = new EntitySet<b2bDtl>(OnDtlAdded, OnDtlremoved);
    }

    private void OnDtlAdded(b2bDtl addedDtl) { addedDtl.hdrRecord = this; }
    private void OnDtlremoved(b2bDtl removedDtl) { removedDtl.hdrRecord = null; }


    [Association(ThisKey = "bhID", Storage = "_b2bDetails", OtherKey = "bhID")]
    public EntitySet<b2bDtl> b2bDetails
    {
        get { return this._b2bDetails; }
        set { this._b2bDetails.Assign(value); }
    }

    [Column(IsPrimaryKey = true, IsDbGenerated = true)] public Int32 bhID { get; set; }
    [Column] public Int32 cusID { get; set; }
    [Column] public int? rtHID { get; set; }
    [Column] public int? inhID { get; set; }
    [Column] public DateTime invoiceDate { get; set; }
    [Column] public DateTime? deliveryDate { get; set; }
    [Column] public Int32 referenceNumber { get; set; }
    [Column] public int? claimNumber { get; set; }
    [Column] public int? CreditInvoice { get; set; }
    [Column] public String CustomerName { get; set; }
    [Column] public Byte Type { get; set; }
    [Column] public Decimal InvoiceTotal { get; set; }
    [Column] public Decimal TaxTotal { get; set; }
    [Column] public Int32 TempID { get; set; }
    [Column] public String Notes { get; set; }
    [Column] public byte? status { get; set; }
    [Column] public Byte Deleted { get; set; }
以下是有关错误的调试信息:

    A first chance exception of type 'System.NotImplementedException' occurred in System.Core.dll
   'sldatasys.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll'. Cannot find or open the PDB file.
   System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>sldatasys.exe</AppDomain><Exception><ExceptionType>System.NotImplementedException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The method or operation is not implemented.</Message><StackTrace>   at System.Linq.Enumerable.Iterator`1.System.Collections.IEnumerator.Reset()
   at System.Windows.Forms.ListBindingHelper.GetFirstItemByEnumerable(IEnumerable enumerable)
   at System.Windows.Forms.ListBindingHelper.GetListItemPropertiesByEnumerable(IEnumerable enumerable)
   at System.Windows.Forms.ListBindingHelper.GetListItemProperties(Object list)
   at System.Windows.Forms.ListBindingHelper.GetListItemProperties(Object list, PropertyDescriptor[] listAccessors)
   at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.SetDataConnection(Object dataSource, String dataMember)
   at System.Windows.Forms.DataGridView.set_DataSource(Object value)
   at DairyProcessing.frmB2BView.btnClearClaimSearch_Click(Object sender, EventArgs e) in c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Forms\frmB2BView.cs:line 223
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at DairyProcessing.Program.Main() in c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Program.cs:line 19</StackTrace><ExceptionString>System.NotImplementedException: The method or operation is not implemented.
   at System.Linq.Enumerable.Iterator`1.System.Collections.IEnumerator.Reset()
   at System.Windows.Forms.ListBindingHelper.GetFirstItemByEnumerable(IEnumerable enumerable)
   at System.Windows.Forms.ListBindingHelper.GetListItemPropertiesByEnumerable(IEnumerable enumerable)
   at System.Windows.Forms.ListBindingHelper.GetListItemProperties(Object list)
   at System.Windows.Forms.ListBindingHelper.GetListItemProperties(Object list, PropertyDescriptor[] listAccessors)
   at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.SetDataConnection(Object dataSource, String dataMember)
   at System.Windows.Forms.DataGridView.set_DataSource(Object value)
   at DairyProcessing.frmB2BView.btnClearClaimSearch_Click(Object sender, EventArgs e) in c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Forms\frmB2BView.cs:line 223
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at DairyProcessing.Program.Main() in c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Program.cs:line 19</ExceptionString></Exception></TraceRecord>
   An unhandled exception of type 'System.NotImplementedException' occurred in System.Core.dll
   Additional information: The method or operation is not implemented.
System.Core.dll中发生了类型为“System.NotImplementedException”的首次意外异常
'sldatasys.exe'(Win32):加载了'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll'。找不到或无法打开PDB文件。
系统。关键事务:0:http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exceptionsldatasys.exeSystem.NotImplementedException,mscorlib,版本=4.0.0.0,区域性=中性,PublicKeyToken=B77A5C561934E089未实现该方法或操作。位于System.Linq.Enumerable.Iterator`1.System.Collections.IEnumerator.Reset()处
位于System.Windows.Forms.ListBindingHelper.GetFirstItemByEnumerable(IEnumerable enumerable)
位于System.Windows.Forms.ListBindingHelper.GetListItemPropertiesByEnumerable(IEnumerable enumerable)
位于System.Windows.Forms.ListBindingHelper.GetListItemProperties(对象列表)
位于System.Windows.Forms.ListBindingHelper.GetListItemProperties(对象列表,PropertyDescriptor[]listAccessors)
位于System.Windows.Forms.BindingContext.EnsureListManager(对象数据源,字符串数据成员)
位于System.Windows.Forms.DataGridView.DataGridViewDataConnection.SetDataConnection(对象数据源,字符串数据成员)
位于System.Windows.Forms.DataGridView.set_数据源(对象值)
在DairyProcessing.frmB2BView.btnClearClaimSearch_单击c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Forms\frmB2BView.cs:第223行中的(对象发送方,事件参数e)
在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs-mevent)上
在System.Windows.Forms.Control.WmMouseUp(消息和m、鼠标按钮、Int32单击)
在System.Windows.Forms.Control.WndProc(Message&;m)中
在System.Windows.Forms.ButtonBase.WndProc(Message&;m)
在System.Windows.Forms.Button.WndProc(Message&;m)中
在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd、Int32 msg、IntPtr wparam、IntPtr lparam)
在System.Windows.Forms.UnsafentiveMethods.DispatchMessageW(MSG&;MSG)
位于System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafentiveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID、Int32 reason、Int32 pvLoopData)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32原因,ApplicationContext上下文)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32原因,ApplicationContext上下文)
在c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Program.cs中的DairyProcessing.Program.Main()处:第19行System.NotImplementedException:未实现该方法或操作。
位于System.Linq.Enumerable.Iterator`1.System.Collections.IEnumerator.Reset()处
位于System.Windows.Forms.ListBindingHelper.GetFirstItemByEnumerable(IEnumerable enumerable)
位于System.Windows.Forms.ListBindingHelper.GetListItemPropertiesByEnumerable(IEnumerable enumerable)
位于System.Windows.Forms.ListBindingHelper.GetListItemProperties(对象列表)
位于System.Windows.Forms.ListBindingHelper.GetListItemProperties(对象列表,PropertyDescriptor[]listAccessors)
位于System.Windows.Forms.BindingContext.EnsureListManager(对象数据源,字符串数据成员)
位于System.Windows.Forms.DataGridView.DataGridViewDataConnection.SetDataConnection(对象数据源,字符串数据成员)
位于System.Windows.Forms.DataGridView.set_数据源(对象值)
在DairyProcessing.frmB2BView.btnClearClaimSearch_单击c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Forms\frmB2BView.cs:第223行中的(对象发送方,事件参数e)
在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs-mevent)上
在System.Windows.Forms.Control.WmMouseUp(消息和m、鼠标按钮、Int32单击)
在System.Windows.Forms.Control.WndProc(Message&;m)中
在System.Windows.Forms.ButtonBase.WndProc(Message&;m)
在System.Windows.Forms.Button.WndProc(Message&;m)中
在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd、Int32 msg、IntPtr wparam、IntPtr lparam)
在System.Windows.Forms.UnsafentiveMethods.DispatchMessageW(MSG&;MSG)
位于System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafentiveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID、Int32 reason、Int32 pvLoopData)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32原因,ApplicationContext上下文)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32原因,ApplicationContext上下文)
在c:\Data\Projects\Stonelees Data Systems\Stonelees Data Systems\Program.cs中的DairyProcessing.Program.Main()处:第19行
System.Core.dll中发生类型为“System.NotImplementedException”的未处理异常
附加信息:未实现该方法或操作。

什么是
b2bHdr
claimNumber
?你能给全班同学看吗?大多数异常问题都是因为对调用堆栈的误解。你能给我们看一个完整的异常调用堆栈吗?还有什么是“混淆之王”变量,
dgvDtl
(即什么类型)?试着调用
claims.Where(…).ToList()
,以获得更有用的堆栈跟踪。实际错误被向右滚动。Linq查询仅向前,绑定源需要能够倒带。使用
dgvDtl.DataSource=filteredClaims.ToList()什么是