﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Calling Add on a Business Object</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 16 Jun 2026 10:48:22 GMT</lastBuildDate><ttl>20</ttl><item><title>Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20325.aspx</link><description>When I call the add method of the business object, I am not getting a new record.&amp;nbsp; &lt;/P&gt;&lt;P&gt;[quote]The CurrentRow for table '[dbo].[ProdWOEquipment]' could not be evaluated because the CurrentRowIndex is out of range.&amp;nbsp; Business object record count: 0.&amp;nbsp; CurrentRowIndex: -1.[/quote]&lt;/P&gt;&lt;P&gt;Here is the call stack:&lt;/P&gt;&lt;P&gt;[quote]&lt;BR&gt;&amp;gt;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentRow() Line 1790&amp;nbsp;Basic&lt;BR&gt;&amp;nbsp;&amp;nbsp;AspireModel.dll!Aspire.Model.ProductionWorkOrderEquipmentBO.createby.set(int value = 1) Line 419 + 0x8 bytes&amp;nbsp;C#&lt;BR&gt;&amp;nbsp;&amp;nbsp;AspireModel.dll!Aspire.Model.ProductionWorkOrderEquipmentBO.ProductionWorkOrderEquipmentBO_SetDefaultValues() Line 77 + 0x1c bytes&amp;nbsp;C#&lt;BR&gt;&amp;nbsp;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.raise_SetDefaultValues() Line 1662 + 0xe bytes&amp;nbsp;Basic&lt;BR&gt;&amp;nbsp;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.OnSetDefaultValues() Line 1673 + 0xa bytes&amp;nbsp;Basic&lt;BR&gt;&amp;nbsp;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.NewRow() Line 6047 + 0xb bytes&amp;nbsp;Basic&lt;BR&gt;&amp;nbsp;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.Add(Boolean CheckSecurity = True) Line 7283 + 0xa bytes&amp;nbsp;Basic&lt;BR&gt;&amp;nbsp;&amp;nbsp;MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.Add() Line 7254 + 0xf bytes&amp;nbsp;Basic&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;The odd things is that I use the same kind of code elsewhere and it runs beautifully.&amp;nbsp; There is something different about this BO's class.&amp;nbsp; I am just not seeing it.&amp;nbsp; I'll keep looking, but if anyone has some tips or tricks to share, I'd appreciate it.&lt;/P&gt;&lt;P&gt;Bill</description><pubDate>Fri, 24 Oct 2008 12:49:54 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20334.aspx</link><description>Ok, I found my notes :P&lt;P&gt;I am calling a child form from a listview, in the childform.Load() I did the following:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;' Force the BO assignment here to fix a problem of the BO.Add() not working properly.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.lstItemService.BusinessObject = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.bizSC_AppliancesItems1&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/code][/codesnippet]&lt;P&gt;I don't know why was this happening and it was very difficult to reproduce in the sample application, so since this worked, I just leave it and moved on to new issues.:hehe:</description><pubDate>Fri, 24 Oct 2008 12:49:54 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20333.aspx</link><description>[quote]Is this a child BO?&amp;nbsp;. . .&amp;nbsp;so let me know if this is a child BO.[/quote]&lt;/P&gt;&lt;P&gt;Yes.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The DB is accessible.&amp;nbsp; I have closed and restarted VS several times.&amp;nbsp; Other similar classes and BOs work just fine (all other applications are hitting the DB without issues).&amp;nbsp; I'll take a closer look at the parent-child relationship.&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR&gt;Bill</description><pubDate>Fri, 24 Oct 2008 11:56:50 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20332.aspx</link><description>[quote][b]Bill Cunnien (10/24/2008)[/b][hr]Does this mean anything?&lt;P&gt;_COMPlusExceptionCode = -532459699[/quote]&lt;P&gt;This is form google:&lt;P&gt;[quote]_COMPlusExceptionCode =&amp;nbsp;-532459699&lt;P align=left&gt;&lt;FONT face=Arial size=2&gt;this error usally occurs when sql connection timeout or if the sql server is down.&lt;/FONT&gt;&lt;/P&gt;&lt;P align=left&gt;i got the same error when i tried to access the webservice which is located in another webserver. (That webserver was down at that time).[/quote]&lt;/P&gt;&lt;P align=left&gt;Maybe you need to close VS and test again.</description><pubDate>Fri, 24 Oct 2008 11:13:55 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20331.aspx</link><description>Hi Bill,&lt;/P&gt;&lt;P&gt;Is this a child BO? I had a similar situation before where the child BO was not creating the new row, don't remember what I did :hehe:, but can look at my project to refresh my memory if needed, so let me know if this is a child BO.</description><pubDate>Fri, 24 Oct 2008 11:09:58 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20330.aspx</link><description>Does this mean anything?&lt;/P&gt;&lt;P&gt;_COMPlusExceptionCode = -532459699</description><pubDate>Fri, 24 Oct 2008 11:08:41 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20329.aspx</link><description>Thanks, Greg.&amp;nbsp; As I walk the code it always bombs as it is setting the first default value.&amp;nbsp; The current row index evaluates as -1.&amp;nbsp; If I comment out the default values, the Add() command still ends up bombing on the get_CurrentRow() method of the BusinessLayer.&amp;nbsp; For some reason the BO is not making a new row in the data table.&amp;nbsp; I will keep testing...maybe a light bulb will go off for me, too.&amp;nbsp; :hehe:</description><pubDate>Fri, 24 Oct 2008 10:59:16 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Calling Add on a Business Object</title><link>http://forum.strataframe.net/FindPost20327.aspx</link><description>Bill,&lt;br&gt;
&lt;br&gt;
It's hard to tell what might going on with just the call stack.  Try setting a break point in SetDefaultValues and step through until you get the error.  Set a watch on the current row index. The light bulbs gone off for me many times by just doing that.</description><pubDate>Fri, 24 Oct 2008 10:01:18 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>