2009-12-02 22 views
9

Sistemimde mükemmel çalışan bir web uygulamasına sahibim. Ancak, başka bir sisteme kopyaladığımda, uygulamaya giriş yapamadım. Hata var:Örnekleme Hatası asp.net

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

Instance failure. 
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.InvalidOperationException: Instance failure. 

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: 


[InvalidOperationException: Instance failure.] 
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4858423 
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90 
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +257 
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4859187 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 
    System.Data.SqlClient.SqlConnection.Open() +122 
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87 
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221 
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815 
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78 
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60 
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119 
    System.Web.UI.WebControls.Login.AttemptLogin() +115 
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101 
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 




-------------------------------------------------------------------------------- 
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 

Böyle bir hatanın nedeni ne olabilir? Bunu nasıl çözebilirim?

cevap

0

Veritabanına bir bağlantı açmaya çalıştığınızda bir hata alıyorsunuz. Bağlantı dizinizdeki kimlik bilgilerini belirliyor musunuz? Aksi takdirde, uygulama havuzunuzun kimliği 2 sunucu arasında muhtemelen farklıdır.

2

Eğer yeni bir sunucuya göre bağlantı dizesini değiştirmeniz gerekir

+1

ASP.NET için SQL üyelik sağlayıcısı kullandığınız gibi geliyor ve belki de genellikle yerel olarak yüklenmiş ve erişilen SQLExpress kullanıyorsunuz. ASP.NET'in doğru SQL Server veritabanı örneğini bulabildiğinden emin olmak için sitenizi başka bir yere kopyaladığınızda bağlantı dizesini güncellemeniz gerekir. –

39

bağlantı dizesi sunucu adı ve veritabanı örnek adı arasında bir çift eğik çizgi içeriyor mu? Örn.,

örn. localhost \\ SQLEXPRESS

Olmalıdır: localhost \ SQLEXPRESS

bakınız: Ben bu sorunu yaşadım ve çoklu SQL Server örneklerini vardı çünkü benim durumumda oldu

http://www.hanselman.com/blog/CommentView.aspx?guid=89c01cae-e045-4b06-bff1-8dd2d596e266

+0

Teşekkürler, bugün tam olarak bu sorunu vardı. –

+0

Biraz farklı bir sorun yaşadım: Benim durumumda, ters eğik çizgi servername sonunda oldu: 'Sunucu =. \ SQLEXPRESS \; Veritabanı = ...'. Bunu şu şekilde düzelttim: Sunucu =. \ SQLEXPRESS; Veritabanı = ... '! –

0

Aynı makineye yüklendi ve hepsi aynı bağlantı noktasını kullanacak şekilde yapılandırıldı.

3

Bu sorunları yaşadım ve benim durumumda "bağlantı dizesi, sunucu adı ve veritabanı örneği adı arasında çift eğik çizgi içeriyor" şeklinde görünüyordu.

2

Web.Config yılında emin bağlantı dizesi çift çizgi
server=(local)\\SQLEXPRESS yok olun ekstra eğik çizgi kaldırıldı ve ben aynı sorunu vardı o çalıştı. server=(local)\SQLEXPRESS

Not: "Tanınmayan kaçış dizisi" Sen bir string olarak bağlantı dizesini tanımlayabilir veya alabilirsiniz eğer .cs dosyaları çift yırtmaç gerekiyor

İlgili konular