Possible bug with MySqlDataset.Tables["blah"].ChildRelations.Clear()

Possible bug with MySqlDataset.Tables["blah"].ChildRelations.Clear()

Postby ashlar64 » Fri 13 Jun 2008 14:26

Hello,

I am wondering if I have stumbled upon a bug?

Here is the code snippet...please note that there is one child relation when a exception is thrown (if there isn't this code does work). The .ChildRelations.Count does go down to 0.



dataset_nds_sites.Tables["Site_ID"].ChildRelations.Clear();
dataset_nds_sites.Tables["Site_ID"].Clear(); // this is where the exception is thrown
adapter_Site_ID.Fill(dataset_nds_sites.Tables["Site_ID"]);


Here is the exception:

System.Data.InvalidConstraintException was unhandled
Message="Cannot clear table Site_ID because ForeignKeyConstraint Scheduler2_To_Site_ID enforces constraints and there are child rows in Scheduler2."
Source="System.Data"
StackTrace:
at System.Data.ForeignKeyConstraint.CheckCanClearParentTable(DataTable table)
at System.Data.DataTable.Clear(Boolean clearAll)
at System.Data.DataTable.Clear()
at iGlimpse2.Window1.Button_Refresh_Site_ID_Click(Object sender, RoutedEventArgs e) in C:\expression\projects\iGlimpse2\Window1.xaml.cs:line 2287
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at iGlimpse2.App.Main() in C:\expression\projects\iGlimpse2\obj\Debug\App.g.cs:line 0
InnerException:
ashlar64
 
Posts: 75
Joined: Thu 04 May 2006 18:56

Postby Alexey.mdr » Tue 17 Jun 2008 09:13

Hello,

Please send me (alexeyman*crlab*com) a small test project to
reproduce the problem.
It is desirable to use 'test' schema objects, otherwise
include the definition of your own database objects.
If it is impossible for you to create the test project, send
us a piece of your code where the error occurs or describe steps to
reproduce the problem.
What is the version/edition of the product you use?

Regards,
Alexey.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby ashlar64 » Tue 17 Jun 2008 12:03

Hello,

I got the latest 4.70.20.0 and I am still getting a exception....I made a test program which I am about to send you but am getting a different exception now.
ashlar64
 
Posts: 75
Joined: Thu 04 May 2006 18:56

Postby Alexey.mdr » Tue 17 Jun 2008 12:45

Hello again,

You can send the project directly to my email.
I will reply you as soon as possible.

Regards,
Alexey.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby ashlar64 » Mon 23 Jun 2008 14:14

Hello Alexey,

I sent a sample project a few days ago....just wanted to make sure you got it?
ashlar64
 
Posts: 75
Joined: Thu 04 May 2006 18:56

Postby Alexey.mdr » Tue 24 Jun 2008 06:57

Hello,

Unfortunately we didn't receive the email.
Could you please resend it on alexeyman*devart*com and to mysqlnet*devart*com?

Regards,
Alexey.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby ashlar64 » Tue 01 Jul 2008 12:41

Hello Alexey,

I sent a sample project awhile back. I am just wondering about the status of it.

---Dave
ashlar64
 
Posts: 75
Joined: Thu 04 May 2006 18:56

Postby anton.connect » Tue 01 Jul 2008 14:04

Hello

Unfortunately we didn't receive the email again.
Could you please resend it on antonc*devart*com from another address?

Regards,
Anton.
anton.connect
 
Posts: 43
Joined: Thu 19 Jun 2008 14:30


Return to dotConnect for MySQL