Blue Ink
Blue InkHomeBlue Ink SolutionsArticlesBlue Ink Net CommunityBlue Ink Demo ApplicationAbout Automated Architecture
My Profile

Recursive Relationships in Visio

View General Forum | Post Response | New Topic

Author Message
Dec 15 2005
6:51 AM
How do I setup a recursive relationship in Visio?
Lee Richardson

Dec 15 2005
7:21 AM

Good point, that is not described in the Data Modeling in Microsoft Visio article. I have made a note to add it. First of all I am asuming you mean adding a parent-child relationship such as who is someone's supervisor in a table of employees.

First drag a relationship onto Visio's drawing surface, conect both ends to a table, add a new column (e.g. SupervisiorEmployeeId), click on the relationship, select properties, and link up the foreign key (SupervisorEmployeeId) and primary key (EmployeeId).

Note that once you have a parent-child relationship such as this you often need a denormalized table so you don't need to write recursive calls to the database. For instance how would you construct a tree of employees without running a select query for every single employee? Let me know if you need help with this, I have some code samples and other resources for the pages of a website that uses this technique.
Dec 15 2005
2:37 PM
Thanks for your response. I have set the recursive relationship up and I am receiving an error. Have any ideas what could cause this error?

Server Error in '/RTM_BEA' Application.

Column 'RequirementSourceType_Requirement_FK1_RequirementSourceType' does not belong to table Requirement.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Column 'RequirementSourceType_Requirement_FK1_RequirementSourceType' does not belong to table Requirement.

Source Error:

Line 47: // or strFormat can be a .net format specifier such as "c" for currency
Line 48: public static void PopulateLabel(Label lbl, DataRow row, string strLogicalColumnName, string strFormat) {
Line 49: if (row.IsNull(strLogicalColumnName)) {
Line 50: lbl.Text = "";
Line 51: } else {

Source File: c:\inetpub\wwwroot\RTM_BEA\UiCommon\UiHelper.cs Line: 49

Stack Trace:

[ArgumentException: Column 'RequirementSourceType_Requirement_FK1_RequirementSourceType' does not belong to table Requirement.]
System.Data.DataRow.IsNull(String columnName) +125
TH.rtm_bea.UiCommon.UiHelper.PopulateLabel(Label lbl, DataRow row, String strLogicalColumnName, String strFormat) in c:\inetpub\wwwroot\RTM_BEA\UiCommon\UiHelper.cs:49
TH.rtm_bea.UiCommon.UiHelper.PopulateLabel(Label lbl, DataRow row, String strLogicalColumnName) in c:\inetpub\wwwroot\RTM_BEA\UiCommon\UiHelper.cs:42
TH.rtm_bea.WebUserControls.Base.Requirement_Identify_Base.Page_Load_Base(Object sender, EventArgs e) in c:\inetpub\wwwroot\RTM_BEA\WebUserControls\Base\Requirement_Identify_Base.cs:46
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750

Lee Richardson

Dec 15 2005
4:07 PM
Please note I have moved this message and the response to the support forum:

View General Forum | Post Response | New Topic


What is Rapid Application Development?


Call us toll free:
(877) 756-3595

Or Visit Forums


Copyright © 2021 Automated Architecture, Inc. All rights reserved.