web.config

Discussion in 'ASP.NET / ASP.NET Core' started by mdean99, Jul 29, 2011.

  1. I am a bit confused about the way that the web.config works re database connections.
    I have the following entry in the web.config file

    <connectionStrings>
    <add name="StampsForSale"
    connectionString="Data Source=xxx.xxx.xxx.xxx;
    Initial Catalog=StampsForSale;Persist Security Info=True; Trusted_Connection=False;
    User ID=xxxxxxxxxxx;
    Password=xxxxxxxxxx" providerName="System.Data.SqlClient" />
    </connectionStrings>

    This works for default.aspx
    but switching to other modules I get the error 'Parser Error Message: The entry 'StampsForSale' has already been added'. There is only one web.config file and I cannot find anywhere how to get round this!
    I would appreciate some help.
    Thanks
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    It is most likely inherited from the parent directory.
     
  3. thanks. That works now.
     
  4. Good job ;-)
     

Share This Page