locked
server error on localhost RRS feed

  • Question

  • User1201051267 posted

    I am running Club through the debug process on localhost. I get this error message. I am using Visual Web Developer 2005 Express.

    Server Error in '/Club' Application. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>


    One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files.  If this is an existing database, the file may be corrupted and should be restored from a backup.
    An attempt to attach an auto-named database for file C:\Documents and Settings\Mark H\My Documents\Visual Studio 2005\Projects\Club\App_Data\Club.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
    <o:p></o:p>

    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: One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files.  If this is an existing database, the file may be corrupted and should be restored from a backup.
    An attempt to attach an auto-named database for file C:\Documents and Settings\Mark H\My Documents\Visual Studio 2005\Projects\Club\App_Data\Club.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

    Source Error: <o:p></o:p>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. <o:p></o:p>


    Stack Trace: <o:p></o:p>

    <o:p> </o:p>

    [SqlException (0x80131904): One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files.  If this is an existing database, the file may be corrupted and should be restored from a backup.<o:p></o:p>

    An attempt to attach an auto-named database for file C:\Documents and Settings\Mark H\My Documents\Visual Studio 2005\Projects\Club\App_Data\Club.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]<o:p></o:p>

       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115<o:p></o:p>

       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346<o:p></o:p>

       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244<o:p></o:p>

       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +56<o:p></o:p>

      

    Here is the web.config code:

    <o:p> 

    <?xml version="1.0"?><o:p></o:p>

    <configuration><o:p></o:p>

          <location path="events_edit.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <allow roles="Administrators"/><o:p></o:p>

                            <deny users="*"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <location path="locations_edit.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <allow roles="Administrators"/><o:p></o:p>

                            <deny users="*"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <location path="news_edit.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <allow roles="Administrators"/><o:p></o:p>

                            <deny users="*"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <location path="photoalbum_new.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <allow roles="Administrators"/><o:p></o:p>

                            <deny users="*"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <location path="member_list.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <deny users="?"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <location path="member_details.aspx"><o:p></o:p>

                <system.web><o:p></o:p>

                      <authorization><o:p></o:p>

                            <deny users="?"/><o:p></o:p>

                      </authorization><o:p></o:p>

                </system.web><o:p></o:p>

          </location><o:p></o:p>

          <connectionStrings><o:p></o:p>

                <add <o:p></o:p>

          name="ClubSiteDB"<o:p></o:p>

          connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|Club.mdf;User Instance=True" <o:p></o:p>

          providerName="System.Data.SqlClient"<o:p></o:p>

        /><o:p></o:p>

          </connectionStrings><o:p></o:p>

          <system.web><o:p></o:p>

        <!--<o:p></o:p>

                <roleManager enabled="true"/><o:p></o:p>

                <authentication mode="Forms"/><o:p></o:p>

        --><o:p></o:p>

        <trace enabled="true" localOnly="false"/><o:p></o:p>

        <authentication mode="Windows"/><o:p></o:p>

        <compilation debug="true" strict="true"><o:p></o:p>

                      <assemblies><o:p></o:p>

                            <add assembly="System.Xml, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><o:p></o:p>

                            <add assembly="System.Messaging, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><o:p></o:p>

                            <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><o:p></o:p>

                      </assemblies><o:p></o:p>

                </compilation><o:p></o:p>

                <membership defaultProvider="AspNetSqlMembershipProvider"/><o:p></o:p>

                <siteMap defaultProvider="AspNetXmlSiteMapProvider" enabled="true"><o:p></o:p>

                      <providers><o:p></o:p>

                            <remove name="AspNetXmlSiteMapProvider"/><o:p></o:p>

                            <add name="AspNetXmlSiteMapProvider" description="SiteMap provider which reads in .sitemap XML files." type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/><o:p></o:p>

                      </providers><o:p></o:p>

                </siteMap><o:p></o:p>

                <customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.htm"/><o:p></o:p>

                <globalization requestEncoding="utf-8" responseEncoding="utf-8"/><o:p></o:p>

          </system.web><o:p></o:p>

    </configuration><o:p></o:p>

    <o:p> </o:p>

    How do I get over this error message?

    Many thanks, mhh12

    </o:p> 

    <o:p></o:p> 

    Saturday, July 22, 2006 4:35 PM

All replies

  • User-1853252149 posted

    Google "A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. "  Tons of info available.

    Jeff<?XML:NAMESPACE PREFIX = O /><O:P></O:P>

    Sunday, July 23, 2006 11:50 AM