StrataFrame Forum

Error Setting Parent Relationship in designer

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

By Larry Caylor - 3/19/2013

I’m getting a “Set Parent Relationship” error message when Itry to set the parent object on a business object instance on a form. I’vechecked to make sure that the relationship has been established on the correctobject in the component designer and have rebuilt the solution a number oftimes.  No matter what I try it can’tseem to find the parent object. The code for the relationship appers to be okin the InitializeComponent sub in the business object’s designer file.  Does any code get added someplace else?

By Larry Caylor - 3/19/2013

The title should have been 'Error Setting Parent Object in Designer'
By Edhy Rijo - 3/19/2013

Hi Larry,

Try the following:
  1. Close VS.
  2. Open it again.
  3. Build the Solution.
  4. Try to assign the Parent BO.
By Larry Caylor - 3/19/2013

Hi Edhy,

Tried that. It doesn't fix the problem.
By Edhy Rijo - 3/19/2013

Hi Larry,

Then you have to review the relationship created at the Business Object Layer (the main class).  Try this:
  1. Reset that relationship to default to remove it and close the BO.
  2. Rebuild the Project
  3. Re-create the relationship, and rebuild project.
  4. Try to assign the Parent BO.
By Larry Caylor - 3/19/2013

Edhy,

Tried that too. Still didn''t fix it. There must be something in the object's designer file or something else I can't see.

I finally worked around the issue by creating a new business object with a slightly different name and replacing the
instance on each of my forms and child forms. The new object worked fine. I'm using VS 2012 and it seems to have more
strange issues than VS 2010. I use the panel manager control a lot and there have been times when VS 2012
"forgets" the controls I've dropped on the pages and I end up having to clean up the form's designer file and
re-drop the controls on the pages. 

-Larry
By Edhy Rijo - 3/20/2013

Hi Larry,
Glad you got it working somehow.  Can you please tell us what was the name of the business object?
By StrataFrame Team - 3/20/2013

VS 2012 has many more issues than VS 2010 ever did.  I have found that if you partially type a line of code, leave the document to check something, then return, it kills Intellisense.  You have to close the document and reopen it to get Intellisense to return.  

Out of curiosity, Larry, what were the details of the error message you were getting?  Do you remember the text of the message?
By Terry Bottorff - 3/20/2013

OH MY. I thought I was losing my mind. It really is happening.  I thought my Intellisense was just screwed up. I feel better now.
By Larry Caylor - 3/20/2013

Hi Ben,

Screen shot of error message is attached. I've checked the object and the parent relationship is defined. I rebuilt the solution, deleted and re-entered the relationship, restated VS a number of times and I still get the error. Finally I created a new object (ApptWindowBO) mapped it to the same table and replaced the instances of AppointmentWindowBO on my forms with the new BO and everything worked as it should. I'm assuming that something is messed up in the original object's designer file unless the relationship information is being stored someplace else in VS.

-Larry
By Trent L. Taylor - 3/21/2013

Larry:

Do you place your BO assembly in the GAC or is it just on disk?  If you have things stored in the GAC, the AppDomain in the development environment acts a little different.  Generally in this case you have to build your assembly and let it get added back to the GAC, then get out of VS, come back in and it will load the NEW BO assembly.
By Larry Caylor - 3/21/2013

Hi Trent,

Thanks for the info. The BO is just on disk. Since it was just happening to this one object I'm writing it off as a VS 2012 quirk. If it happens again I'll spend more time on it.

-Larry