H
H Branyan
Please see this error below. This code runs fine in v1.0, but I just
compiled it and ran it in v1.1. The first time the page loads, everything is
OK, but if you hit refresh or navigate away and come back to the page, the
following error occurs:
A column named 'ORG' already belongs to this DataTable: cannot set a nested
table name to the same name.
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.Data.DuplicateNameException: A column named 'ORG'
already belongs to this DataTable: cannot set a nested table name to the
same name.
Source Error:
Line 115:
Line 116: DataRelation drel = new DataRelation("ORG_RECURSIVE",
ds.Tables["ORG"].Columns["Org_ID"],
ds.Tables["ORG"].Columns["Parent_Org_ID"]);
Line 117: drel.Nested = true; // this line throws error
Line 118: ds.Relations.Add( drel );
Line 119:
Stack Trace:
[DuplicateNameException: A column named 'ORG' already belongs to this
DataTable: cannot set a nested table name to the same name.]
System.Data.DataColumnCollection.RegisterName(String name, Object obj) +246
System.Data.DataRelation.set_Nested(Boolean value) +418
MERC.AircatWeb.Applications.NewUser.LoadTreeView() in
c:\hmb_aircat_dev\c130_aircat\aircat_web\applications\newuser.aspx.cs:117
MERC.AircatWeb.Applications.NewUser.Page_PreRender(Object sender, EventArgs
e) in
c:\hmb_aircat_dev\c130_aircat\aircat_web\applications\newuser.aspx.cs:76
System.Web.UI.Control.OnPreRender(EventArgs e) +67
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Page.ProcessRequestMain() +1466
++++
I am not having any luck rewriting this code, so if anyone could help, I
would appreciate it. Thank you.
compiled it and ran it in v1.1. The first time the page loads, everything is
OK, but if you hit refresh or navigate away and come back to the page, the
following error occurs:
A column named 'ORG' already belongs to this DataTable: cannot set a nested
table name to the same name.
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.Data.DuplicateNameException: A column named 'ORG'
already belongs to this DataTable: cannot set a nested table name to the
same name.
Source Error:
Line 115:
Line 116: DataRelation drel = new DataRelation("ORG_RECURSIVE",
ds.Tables["ORG"].Columns["Org_ID"],
ds.Tables["ORG"].Columns["Parent_Org_ID"]);
Line 117: drel.Nested = true; // this line throws error
Line 118: ds.Relations.Add( drel );
Line 119:
Stack Trace:
[DuplicateNameException: A column named 'ORG' already belongs to this
DataTable: cannot set a nested table name to the same name.]
System.Data.DataColumnCollection.RegisterName(String name, Object obj) +246
System.Data.DataRelation.set_Nested(Boolean value) +418
MERC.AircatWeb.Applications.NewUser.LoadTreeView() in
c:\hmb_aircat_dev\c130_aircat\aircat_web\applications\newuser.aspx.cs:117
MERC.AircatWeb.Applications.NewUser.Page_PreRender(Object sender, EventArgs
e) in
c:\hmb_aircat_dev\c130_aircat\aircat_web\applications\newuser.aspx.cs:76
System.Web.UI.Control.OnPreRender(EventArgs e) +67
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Page.ProcessRequestMain() +1466
++++
I am not having any luck rewriting this code, so if anyone could help, I
would appreciate it. Thank you.