StrataFrame Forum

Error during deleting BO record in a Form

http://forum.strataframe.net/Topic26135.aspx

By Luiz Lima - 2/20/2010

Hi,

I have a form with a ParentBO and 3 children (I´m using DevExpress grid with BBS).
When I try to delete the record by Form, appears this message below.

I´ve been looking for some configurations on my BOParent or Form and .. Nothing....Crying
This occurs when BoChildren are filled or not.

Some help guys?

--------------------------------------------------------------------------------------------------------
NullReferenceException
  Object reference not set to an instance of an object.

Source     : MicroFour StrataFrame Business

Stack Trace:
   at MicroFour.StrataFrame.Business.BusinessLayer.DeleteChildRecords(Boolean OnlyMarkAsDeleted)
   at MicroFour.StrataFrame.Business.BusinessLayer.DeleteCurrentRow(Boolean CheckSecurity, Boolean OnlyMarkAsDeleted)
   at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.Delete(Boolean OnlyMarkAsDeleted, Boolean CheckSecurity)
   at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdDelete_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--------------------------------------------------------------------------------------------------------

By Trent L. Taylor - 2/22/2010

Well, there is not enough information for me to work with here. It almost seems like something is being re-evaluated in the grid, but I cannot tell for sure.



1. Does this happen when you are not bound to a grid?

2. Build the StrataFrame source code in debug mode so that we can at least see a line number which might clue us in. A NullReferenceException is a totally ambiguous exception to work off of here.



Or



3. Create a sample that reproduces the problem and post it so we can look at this ourselves.
By Luiz Lima - 2/22/2010

1. Does this happen when you are not bound to a grid?
R: Primary BO is bound to form and others three BOs are bound to grids.

2. Build the StrataFrame source code in debug mode so that we can at least see a line number which might clue us in. A NullReferenceException is a totally ambiguous exception to work off of here.
R: How can I do that?

Or

3. Create a sample that reproduces the problem and post it so we can look at this ourselves.
R: I´m working in another form to see if this problem occurs.

Tks

By Ivan George Borges - 2/22/2010

2. Build the StrataFrame source code in debug mode so that we can at least see a line number which might clue us in. A NullReferenceException is a totally ambiguous exception to work off of here.
R: How can I do that?

Luiz,

Install the source code using the EXE provided in the Downloads. Open the StrataFrame source code solution, place it in Debug mode, and then build it. There is a .bat file that will register the DLLs in the GAC.

To place it in Debug mode, have a look at your VS Build menu, and see if you can find the "Configuration Manager..." option. If not, go to Tools, Options, Projects and Solutions, General and check the "Show advanced build configurations". Then, have a look at it and you will find the Debug/Release configuration option.

By Luiz Lima - 2/23/2010

Guys,

I tested with a form nears of it and works fine.
Today I will check all configurations before debug SF Source.

Tks

By Trent L. Taylor - 2/24/2010

Good to hear. Thanks for your help, Ivan! Smile
By Luiz Lima - 3/5/2010

Guys,

I discovered what the problem was.
I had a BO configured with a wrong parent... Blush

Sorry..

Tks again

By Trent L. Taylor - 3/8/2010

Cool Cool Glad you got it figured out!