My business object is not getting populated


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
The data table for the BO is getting filled correctly after calling the stored procedure but I am getting an error that says "Object reference not set to an instance of an object"

I have been stepping throught he framework code and the problem is occurring in the ListChanged event of BusinessBindingSource.vb on the line

RaiseEvent ListChanged(Me, e)

What would cause this and how can I fix the problem?

TIA

Marcia


Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
What is the full stack trace so we can see what "object" and method that is this failing on.  There are a lot of possible causes on this one.  The more information you could provide the better.  The ListChanged event is nothing more than an implementation of the IBindingList which notifies any bound objects that the contents of the List (collection) has been changed so to take appropriate action (which is generally a refresh).  So it sounds like when you are repopulating the BO that one of the controls to which it is bound is expected something that is not there.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (09/26/2008)
What is the full stack trace so we can see what "object" and method that is this failing on.  There are a lot of possible causes on this one.  The more information you could provide the better.  The ListChanged event is nothing more than an implementation of the IBindingList which notifies any bound objects that the contents of the List (collection) has been changed so to take appropriate action (which is generally a refresh).  So it sounds like when you are repopulating the BO that one of the controls to which it is bound is expected something that is not there.

Here is the full stack trace:

   at Trinity.Forms.Notes.grdViewNoteLog_RowEnter(Object sender, DataGridViewCellEventArgs e) in F:\Trinity_new\Trinity\Forms\Notes.cs:line 255
   at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCellEventArgs e)
   at System.Windows.Forms.DataGridView.OnRowEnter(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, Boolean canCreateNewRow, Boolean validationFailureOccurred)
   at System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
   at System.Windows.Forms.DataGridView.SetAndSelectCurrentCellAddress(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick, Boolean clearSelection, Boolean forceCurrentCellSelection)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.MatchCurrencyManagerPosition(Boolean scrollIntoView, Boolean clearSelection)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.ProcessListChanged(ListChangedEventArgs e)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.currencyManager_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
   at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
   at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessBindingSource.OnListChanged(ListChangedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessBindingSource.BusinessObject_CurrentDataTableRefilled()
   at MicroFour.StrataFrame.Business.BusinessLayer.raise_CurrentDataTableRefilled()
   at MicroFour.StrataFrame.Business.BusinessLayer.OnCurrentDataTableRefilled()
   at MicroFour.StrataFrame.Business.BusinessLayer.ChangeCurrentDataTable(DataTable NewTable, Boolean AcceptChanges, Boolean IsSharedTable)
   at MicroFour.StrataFrame.Business.BusinessLayer.ChangeCurrentDataTable(DataTable NewTable, Boolean AcceptChanges)
   at MicroFour.StrataFrame.Business.BusinessLayer.ChangeCurrentDataTable(DataTable NewTable)
   at MicroFour.StrataFrame.Business.BusinessLayer.FillDataTable(DbCommand CommandToExecute)
   at Trinity.BusinessObjects.boViewNoteLog.GetClientNotes(Int32 tnClient_pk) in F:\Trinity_new\Trinity\BusinessObjects\boViewNoteLog.cs:line 75
   at Trinity.Forms.Notes.GetClientNotes(Int32 tnclient_pk) in F:\Trinity_new\Trinity\Forms\Notes.cs:line 31
   at Trinity.Forms.Prospects.tbrMaintenance_ItemClicked(Object sender, ToolStripItemClickedEventArgs e) in F:\Trinity_new\Trinity\Forms\Prospects.cs:line 410
   at System.Windows.Forms.ToolStrip.OnItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStrip.HandleItemClick(ToolStripItem dismissingItem)
   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)

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There is something failing within the grid on the RowEnter.  Without looking at your code I will not be able to give you any straight answers.  But this doesn't look to be framework related, but rather within the grid in the application.  The first thing I would do is remove the grid from the equation to see if the error persists.  Remove the binding of the BBS to the grid and populate it so that the grid events are not part of the formula.  Then start working backwards from there.
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Trent L. Taylor (09/26/2008)
What is the full stack trace so we can see what "object" and method that is this failing on. 

OK - you gave me the inspiration to fix this. While looking at the stack trace, I could see why the problem was happening. All I needed to do was to set some flags so that certain things would not happen before the form was fully instantiated. Thanks for the push in the right directions Smile

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Cool Cool.  Glad you found the problem.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search