欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

突然无法连接数据库了(解决了)

发布时间:2025/3/15 数据库 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 突然无法连接数据库了(解决了) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
NET环境是1.1的,当使用sqlconnection对象并用open方法打开数据库连接时,就会产生如下异常信息:

System.NullReferenceException: 未将对象引用设置到对象的实例。 at LoadLibraryW(UInt16* ) at System.EnterpriseServices.Thunk.Security.Init() at System.EnterpriseServices.Thunk.Security.SuspendImpersonation() at System.EnterpriseServices.Platform.Initialize() at System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb) at System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) at System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl ctrl) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at WLearningCommon.AuthorizationFactory.createAuthorization(String userid, String password, String currentrole) in f:\wlearning\wlearningcommon\authorizationfactory.cs:line 20 at WLearning.AjaxMethodLib.CheckUser.GetUserLogin(IJavaScriptObject Obj) in f:\wlearning\wlearning\ajaxmethodlib\checkuser.cs:line 34

  源码前段时间在机子上调试是完全正常的,竟然出来这种非常奇怪的错误!无语了

  后来,经过一番搜索,终于得知问题是出在操作系统上,需要为.NET环境打个补丁,那就是.NET Framework 1.1 SP1。
  .NET Framework 1.1 SP1 说明:Microsoft .NET Framework 1.1 Service Pack 1 (SP1) 主要的特点是改善了安全性。此外,此 Service Pack 还包括了针对自发布 Microsoft .NET Framework 1.1 以来报告的所有客户问题的累积修补程序。特别值得一提的是,SP1 对使用 WSDL 文档、防止数据执行和防范安全性问题(例如缓冲区溢出)提供了更好的支持。

转载于:https://www.cnblogs.com/xuxu1390/archive/2008/02/03/1063495.html

总结

以上是生活随笔为你收集整理的突然无法连接数据库了(解决了)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。