I do not understand why I am getting this error


Author
Message
Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

The BO that is causing this error is for an allocation table that I am manipulating in code. All I did was drop it on the form - I did not bind it to any controls. Now I can no longer bring the form up because of this error. Any ideas?

BusinessLayerException
  The CurrentRow for table '[dbo].[planparticipant]' could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.

Source     : MicroFour StrataFrame Business

Stack Trace:
   at MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentRow()
   at Trinity.BusinessObjects.boPlanParticipant.get_plan_fk() in F:\Trinity_new\Trinity\BusinessObjects\boPlanParticipant.Designer.cs:line 320
   at Trinity.Forms.Participants.boParticipants_Navigated(NavigatedEventArgs e) in F:\Trinity_new\Trinity\Forms\Participants.cs:line 83
   at MicroFour.StrataFrame.Business.BusinessLayer.NavigatedEventHandler.Invoke(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.ForceNavigatedAndBoundRefresh(Boolean dataTableRefilled)
   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.boParticipants.GetParticipant(Int32 tnParticpant_pk) in F:\Trinity_new\Trinity\BusinessObjects\boParticipants.cs:line 63
   at Trinity.Forms.Participants.GetCurrentParticipant(Int32 tnParticipant_pk, Boolean tlPutInEditMode) in F:\Trinity_new\Trinity\Forms\Participants.cs:line 48
   at Trinity.Forms.Plans.EditParticipant(Boolean tlPutInEditMode) in F:\Trinity_new\Trinity\Forms\Plans.cs:line 252
   at Trinity.Forms.Plans.grdParticipants_DoubleClick(Object sender, EventArgs e) in F:\Trinity_new\Trinity\Forms\Plans.cs:line 302
   at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
   at System.Windows.Forms.DataGridView.OnDoubleClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.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)

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Marcia,

You should test for BO.Count > 0 before using any of its properties.

Trinity.BusinessObjects.boPlanParticipant.get_plan_fk() -> this is the code failing, enclose it in the above test and you should be fine.

Edhy Rijo

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Edhy Rijo (01/29/2009)
Hi Marcia,

You should test for BO.Count > 0 before using any of its properties.

Trinity.BusinessObjects.boPlanParticipant.get_plan_fk() -> this is the code failing, enclose it in the above test and you should be fine.

This is not my code - it is framework code. I do not have code anywhere that accesses noPlanParticipant - it is just sitting on the form.

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Edhy Rijo (01/29/2009)
Hi Marcia,

You should test for BO.Count > 0 before using any of its properties.

Trinity.BusinessObjects.boPlanParticipant.get_plan_fk() -> this is the code failing, enclose it in the above test and you should be fine.

 

Actually, to be more precise, this is code that was generated by the business object mapper...

Marcia G Akins
Marcia G Akins
StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)StrataFrame User (496 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Edhy Rijo (01/29/2009)
Hi Marcia,

You should test for BO.Count > 0 before using any of its properties.

Trinity.BusinessObjects.boPlanParticipant.get_plan_fk() -> this is the code failing, enclose it in the above test and you should be fine.

I got it fixed - thanks for trying to help. And yes, the problem was that my code was trying to access one of the BO's properties and I stupidly missed it Blush

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
You're welcome.

Edhy Rijo

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