本文介绍了尝试为文件C附加自动命名的数据库:\ Users \Administrator \Desktop \ ... \ App_Data \ aspnetdb.mdf失败。存在同名的数据库,或者无法打开指定的文件,或者......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在iis上部署我的网站时出现上述错误。请帮忙。谢谢!



Hi,

I have the above error when i deployed my website on iis. Please help. Thanks!

[SqlException (0x80131904): An attempt to attach an auto-named database for file C:\Users\Administrator\Desktop\...\App_Data\aspnetdb.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.OnError(SqlException exception, Boolean breakConnection) +6277312
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6292062
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6291977
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +831
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6293782
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1922
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6296606
   System.Data.SqlClient.SqlConnection.Open() +300
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +150
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +4603263
   System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +3840667
   System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +505
   System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +400
   System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +216
   System.Configuration.SettingsBase.get_Item(String propertyName) +102
   System.Web.Profile.ProfileBase.GetInternal(String propertyName) +49
   System.Web.Profile.ProfileBase.get_Item(String propertyName) +129
   ProfileCommon.get_SCart() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\chinatownse\ba42903d\b3dbfd80\App_Code.vzqzshan.21.cs:48
   _P__Products_Offer.Page_Load(Object sender, EventArgs e) in c:\Users\Administrator\desktop\chinatown social enterprise (cse) portal updated\(P) Products Offer.aspx.cs:52
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048

推荐答案



这篇关于尝试为文件C附加自动命名的数据库:\ Users \Administrator \Desktop \ ... \ App_Data \ aspnetdb.mdf失败。存在同名的数据库,或者无法打开指定的文件,或者......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 06:08