locked
ConnectionString Error Blues RRS feed

  • Question

  • User-886583467 posted

    I'm getting the following error when I try to view my Extended Club Website in a browser:

    Server Error in '/FTMLounge_Site' Application.

    Object reference not set to an instance of an object.

    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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 1980:        private void InitConnection() {
    Line 1981:            this._connection = new System.Data.SqlClient.SqlConnection();
    Line 1982:            this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ClubSiteDB"].ConnectionString;
    Line 1983:        }
    Line 1984:        


    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ftmlounge_site\ac9bf057\f891c13e\App_Code.kclnxkuj.3.cs    Line: 1982

    I've created my own database (FTMLoungeDB) to be used here. Does this mean I have to do a "Find and Replace" on every occurrance of "ClubSiteDB" within the Solution? There HAS to be an easier way! Can someone tell me what it is? Thanks.

    Andre---

    Monday, December 17, 2007 8:04 AM

All replies

  • User-1509636757 posted

    you might have done it so far... but can you check: 

    The ConnectionStrings  section of your web.config file..

    there would be ClubSiteDB key with connection string value.. change the connection string for FTMLoungeDB with that connection string..

     

    Good Luck./. 

    Monday, December 17, 2007 8:33 AM
  • User-886583467 posted

    Yep. I think I already did that. Here's the connectionstring I have:

    <add name="FTMLoungeDB" connectionString="initial catalog=FTMLoungeDB;Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|FTMLounge.mdf;User Instance=True" providerName="System.Data.SqlClient"/>

     

    Is this correct?

    Monday, December 17, 2007 10:25 AM
  • User-886583467 posted

    Ok. I think I fixed the previous problem, but now I'm gettingthe following error:

    Server Error in '/FTMLounge_Site' Application.

    Invalid object name 'SiteSettings'.

    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.SqlClient.SqlException: Invalid object name 'SiteSettings'.

    Source Error:

    Line 2000:            this.Adapter.SelectCommand = this.CommandCollection[0];
    Line 2001:            DataSet.SiteSettingsDataTable dataTable = new DataSet.SiteSettingsDataTable();
    Line 2002:            this.Adapter.Fill(dataTable);
    Line 2003:            return dataTable;
    Line 2004:        }


    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ftmlounge_site\ac9bf057\f891c13e\App_Code.kp60z3ue.6.cs    Line: 2002

    I thought once I set up the database and configured the connection string these starter kits were just supposed to work. What's going on here?

     

    Dre---

    Monday, December 17, 2007 12:48 PM