BindingSource.Clear comes up with an error
Posted: Thu 09 Jun 2011 09:54
Hey
Using your componets: 6.30.165 with VB.NET 2010
When I run the following code a second time:
I get an error:
Cannot remove an entity that has not been attached.
Stacktrace:
bei Devart.Data.Linq.Table.b(Object A_0, MetaType A_1, Dictionary`2 A_2, Boolean A_3)
bei Devart.Data.Linq.Table.b(Object A_0, Boolean A_1)
bei Devart.Data.Linq.Table`1.DeleteAllOnSubmit[TSubEntity](IEnumerable`1 entities)
bei Devart.Data.Linq.DataBindingList`1.a()
bei System.Collections.ObjectModel.Collection`1.Clear()
bei System.Windows.Forms.BindingSource.Clear()
bei DevartPr.Form1.myError() in C:\Users\Intelli Soft\documents\visual studio 2010\Projects\DevartPr\Form1.vb:Zeile 12.
bei DevartPr.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\Intelli Soft\documents\visual studio 2010\Projects\DevartPr\Form1.vb:Zeile 17.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei DevartPr.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()[/code]
Using your componets: 6.30.165 with VB.NET 2010
When I run the following code a second time:
Code: Select all
Using mmydatacontext As New VOptNeuContext.VOptNeuDataContext With {.Log = Console.Out}
Dim Kunde = From Query In mmydatacontext.Kundenstamms Where _
Query.Nname = "Mayer" And Query.Vname = "Muster"
bsTryIt.DataSource = Kunde
bsTryIt.Clear() 'At second Time running this query, I get the error: Cannot remove an entity that has not been attached.
End Using
I get an error:
Cannot remove an entity that has not been attached.
Stacktrace:
bei Devart.Data.Linq.Table.b(Object A_0, MetaType A_1, Dictionary`2 A_2, Boolean A_3)
bei Devart.Data.Linq.Table.b(Object A_0, Boolean A_1)
bei Devart.Data.Linq.Table`1.DeleteAllOnSubmit[TSubEntity](IEnumerable`1 entities)
bei Devart.Data.Linq.DataBindingList`1.a()
bei System.Collections.ObjectModel.Collection`1.Clear()
bei System.Windows.Forms.BindingSource.Clear()
bei DevartPr.Form1.myError() in C:\Users\Intelli Soft\documents\visual studio 2010\Projects\DevartPr\Form1.vb:Zeile 12.
bei DevartPr.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\Intelli Soft\documents\visual studio 2010\Projects\DevartPr\Form1.vb:Zeile 17.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei DevartPr.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()[/code]