Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2007, 02:39 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server Error in '/XCopyDeploy' Application

hi there,
i'm using visual web developer express edition 2005 to make internal web site using asp.net and sql server 2005 express,sql server management studio for attaching the db(company.mdf),windows xp professional and IIS for deploying the project.the project is working fine when i run it using localhost with explorer only the default page is running but when i access the other pages which have connection with the DB i got this error

Unable to open the physical file "D:\XCopyDeploy\App_Data\company.mdf". Operating system error 5: "5(error not found)".
An attempt to attach an auto-named database for file D:\XCopyDeploy\App_Data\company.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
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: Unable to open the physical file "D:\XCopyDeploy\App_Data\company.mdf". Operating system error 5: "5(error not found)".
An attempt to attach an auto-named database for file D:\XCopyDeploy\App_Data\company.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

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.

Stack Trace:


[SqlException (0x80131904): Unable to open the physical file "D:\XCopyDeploy\App_Data\company.mdf". Operating system error 5: "5(error not found)".
An attempt to attach an auto-named database for file D:\XCopyDeploy\App_Data\company.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
   System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +734963
   System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
   System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
   System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
   System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
   System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +496
   System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1770
   System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +17
   System.Web.UI.WebControls.DataBoundControl.Perform Select() +149
   System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +70
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +82
   System.Web.UI.WebControls.CompositeDataBoundContro l.CreateChildControls() +69
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Control.PreRenderRecursiveInternal() +161
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360


the connection string is
<connectionStrings>
<add name="companyConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\XCopyDeplo y\App_Data\company.mdf;Integrated Security=SSPI;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
the strange thing is!.when i put the port number in the path.it worked fine
(http://localhost:1324/XCopyDeploy/vaccation.aspx) but without 1324 it didnt work.
the question is i should deploy the project on web server (windows server 2003) using same tools
should i do same thing ????because it's internal website and everyone in the company should see it.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Application Error Picabrillo BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 12 May 16th, 2006 06:08 AM
Server Error in '/' Application jamesbie ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2005 05:35 AM
Server Application Error cis BOOK: Beginning ASP.NET 1.0 2 February 12th, 2004 06:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.