Results 1 to 4 of 4

Thread: please help, i am trying to edit the web.config file from within a web app but..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128

    please help, i am trying to edit the web.config file from within a web app but..

    please help, i am trying to edit the web.config file from within a web app but i am getting this error


    Server Error in '/IISapps' Application.
    --------------------------------------------------------------------------------

    The same table (add) cannot be the child table in two nested relations.
    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: The same table (add) cannot be the child table in two nested relations.



    i have crystal reports and appSettings setup in my web.config file:

    <compilation>
    <assemblies>
    <add assembly="CrystalDecisions.CrystalReports..../>
    <add assembly="CrystalDecisions.ReportSource..../>
    <add assembly="CrystalDecisions.Shared..../>
    <add assembly="CrystalDecisions.Web..../>
    </assemblies>
    </compilation>

    and

    <appSettings>
    <add key="gConnection" value="data source=localhost../>
    </appSettings>

    so there are two streams of "add" can i change these so i can use this line of code:

    Dim dr() As DataRow = ds.Tables("add").Select(String.Concat("key='", key, "'"))

    ???????

    any ideas??

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    Sorry I'm here to provide a solution but I would suggest that when you do find one use a custom configuration file. When web.config is altered it causes the application to restart which is not desirable (i.e. slower performance for the user).

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    128
    custom.config??

    when i set the connection in the componant it automatically creates the "add key" in the web.config and i can't change it to custom.config!

    can i put the crystal reports section into the custom.config file?

  4. #4
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    You could create a config.xml and edit it using datasets or xml writers. If, as you say, you are using a component it sounds like it uses the web.config by default. Can you change this?
    Also only change values in the appSettings section. This is the only part of web.config designed for custom values.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width