Business Object causing Visual Studio IDE to crash


Author
Message
Michael Cobb
Michael Cobb
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 26, Visits: 1K
I have a DLL called CommonBOs.DLL containing over 60 business objects.  One of the BOs in that DLL is called PropertyBO. 

In Visual Studio 2005 SP1, I have a VB2005 StrataFrame project with a form that contains an instance of PropertyBO.  Whenever I display the form in design mode the IDE crashes.

I rebuilt and cleaned the project multiple times with the problem continuing to occur.

I started another instance of Visual Studio and attach it to the instance that crashes and sent the debug code to the new instance.  I receive the following message.

System.Reflection.TargetInvocationException was unhandled
Message: Property accessor 'Locked' on object 'PropertyBO1' threw the following exception:'The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.'

I've rebuilt the business objects, recompiled the DLL and replaced the original DLL in the project.  If I remove the old and drop the new PropertyBO on the form it causes the same problem.  I can reproduce the problem by clicking on the PropertyBO1 instance in design mode.  If I drop other BOs from the DLL onto the form no crash occurs. 

So far I haven't noticed the IDE crashing unless I'm displaying the form in Design mode.

Any ideas on how to troubleshoot this further?

Thanks!

Reply
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: 6.9K
Any ideas why having a column called Locked is a problem? 

If you create a column with a different name does the error persist?  I think it will.  I don't think that the column name Locked is your problem.

The error message that you are getting indicates that it is trying to read from the table, which at design time, has no data within it.  If you have created a custom control or something that is firing a New() or constructor code in the designer then you will need to test on whether you are in design mode or not....otherwise this error will always appear.

The message just indicates that the Get is being fired and CurrentRowIndex and CurrentRow does not actually represent any data.  So you need to see where the Locked property is trying to be read and then you should be able to work backwards.

FYI....to test on design mode use the DesignMode property of the user control or form you are working on:

If Not MyForm.DesignMode Then
    '-- Place your code here
End If

Are there other column names that cannot be used in conjunction with StrataFrame Business Objects?

This has nothing to do with SF but rather .NET....and you can name a column pretty much anything you want...including reserved words or types in most cases, such as Type.  I could create a property named type and just make sure that in VB.NET it is surrounded with square brackets or preceeded with an @ symbol in C#.

Public Property [Type] As System.Type
  '----
End Property

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