我在 Microsoft SQL Server 2008 R1 和 Visual Studio 2010 上工作。我的目标是将服务器克隆到新机器上。但是,在设置应用程序并在浏览器的 URL 中输入“local/storytelling”后,会出现错误消息。在谷歌可能的错误之后,我已将身份验证模式表单“Windows身份验证模式”设置为“SQL Server和Windows身份验证模式”。但是错误仍然存在......我现在不知道了。
这是错误消息:
[SqlException (0x80131904): 用户 'storytelling' 登录失败。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System. Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin( ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host,String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds.. ctor(DbConnectionPoolIdentity identity,SqlConnectionString connectionOptions,对象 providerInfo,String newPassword,SqlConnection owningObject,Boolean redirectedUserInstance)+189 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions 选项,对象 poolGroupProviderInfo,DbConnectionPool 池,DbConnection owningConnection)+185 System.Data。 ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection,DbConnectionPool 池,DbConnectionOptions 选项)+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 _Default .Page_Load(Object sender, EventArgs e) in D:\storytelling\Default.aspx.vb:21 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page。ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+627
我不知道代码有什么问题:(源文件:“Default.aspx.vb”)
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("StoryTelling2ConnectionString").ConnectionString)
Dim cmmd As New SqlCommand
Dim strSQL As String
conn.Open()
错误日志以红色突出显示 conn.Open()。我想这可能是我在克隆服务器时丢失了一些步骤。但我不知道我忽略了哪些步骤。请提供一些建议。谢谢。