我有一个应用程序经常访问数据库以获得许多功能。它运行了好几天。今天早上我收到了一个System.Data.SqlClient.SqlException
例外。发生这种情况时,应用程序没有做任何不正常的事情。关于造成这种情况或将来如何防止这种情况的任何想法?
Windows 事件日志
NT AUTHORITY\SYSTEM
Reason: Failed to open the explicitly specified database.
[CLIENT: <local machine>]
异常堆栈跟踪
System.Data.SqlClient.SqlException (0x80131904):
Cannot open database ""MyDB"" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\SYSTEM'.
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges()
at ***.SubmitContextChanges(DataContext dataContext, Int32 counter) in c:\Work\***.cs:line 332
紧随其后的 Windows 事件
Attempting to load library 'xpstar.dll' into memory.
This is an informational message only. No user action is required.