当前位置: 代码迷 >> Sql Server >> 用户 'sa' 登录失败,该怎么处理
  详细解决方案

用户 'sa' 登录失败,该怎么处理

热度:353   发布时间:2016-04-27 13:33:50.0
用户 'sa' 登录失败
情况大致是这样
1.SQL SERVER 2008
2.sa配置正常,SQL Server Management Studio 用windows验证登陆和SQL验证(sa)登陆都正常

3.
C# code
"server=localhost;database=master;integrated security=SSPI"

登陆成功
出现状况:

C# code
"server=localhost;database=master;uid=sa;pwd=sa"



用户 'sa' 登录失败




C# code
未处理 System.Data.SqlClient.SqlException  Message="用户 'sa' 登录失败。"  Source=".Net SqlClient Data Provider"  ErrorCode=-2146232060  Class=14  LineNumber=65536  Number=18456  Procedure=""  Server="localhost"  State=1  StackTrace:       在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)       在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)       在 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)       在 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)       在 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)       在 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)       在 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)       在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)       在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)       在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)       在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)       在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)       在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)       在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)       在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)       在 System.Data.SqlClient.SqlConnection.Open()       在 ConsoleApplication1.Program.OpenSqlConnection() 位置 C:\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:行号 21       在 ConsoleApplication1.Program.Main(String[] args) 位置 C:\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:行号 13       在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)       在 System.Threading.ThreadHelper.ThreadStart()  InnerException: 
  相关解决方案