locked
The connection name 'ClubSiteDB' was not found RRS feed

  • Question

  • User2008459119 posted

    Can someone please help, I am very new to all of this?   I used this template in Visual Web Developer Express 2008 and receive this error when I put the websie on the server.

    The Web.Config page has this code:

    <ConnectionStrings>add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User " providerName="System.Data.SqlClient"/>connectionStrings>

     

    Server Error in '/' Application.

    The connection name 'ClubSiteDB' was not found in the applications configuration or the connection string is empty.

    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.

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


    Source Error:

     


    Stack Trace:

    [InvalidOperationException: The connection name 'ClubSiteDB' was not found in the applications configuration or the connection string is empty.]
       System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +2959805
       ASP.default_aspx.__BuildControlSqlDataSource1() +96
       ASP.default_aspx.__BuildControlContent1(Control __ctrl) +208
       System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
       ASP.default_master.__BuildControlContentPlaceHolder1() +101
       ASP.default_master.__BuildControlform1() +87
       ASP.default_master.__BuildControlTree(default_master __ctrl) +193
       ASP.default_master.FrameworkInitialize() +34
       System.Web.UI.UserControl.InitializeAsUserControlInternal() +31
       System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1980896
       System.Web.UI.Page.get_Master() +48
       System.Web.UI.Page.ApplyMasterPage() +18
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +543
    

    Wednesday, July 21, 2010 7:56 PM

Answers

  • User-861155893 posted

    <ConnectionStrings>add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User " providerName="System.Data.SqlClient"/>connectionStrings>


    should be

    <connectionStrings>
    <add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User " providerName="System.Data.SqlClient"/>
    </connectionStrings>


    NOTE: I use c#. this may be different for vb (Capitalised 'C' perhaps in connectionStrings)

    The error was missing < at beggining of <add /> and </ missing from closing tag

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 21, 2010 9:17 PM

All replies

  • User-861155893 posted

    <ConnectionStrings>add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User " providerName="System.Data.SqlClient"/>connectionStrings>


    should be

    <connectionStrings>
    <add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User " providerName="System.Data.SqlClient"/>
    </connectionStrings>


    NOTE: I use c#. this may be different for vb (Capitalised 'C' perhaps in connectionStrings)

    The error was missing < at beggining of <add /> and </ missing from closing tag

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 21, 2010 9:17 PM
  • User2008459119 posted

    I guess that fixed it, I have a new error now.  Thank you for the quick response. 

    Wednesday, July 21, 2010 9:30 PM
  • User-861155893 posted

    <strike>Kewl... can you mark as answer please and post your new error if you like</strike>

    I see you marked sorry.



    Wednesday, July 21, 2010 9:30 PM