事件代码: 3005 
事件消息: 发生了未处理的异常。 
事件时间: 2009/7/17 16:27:00 
事件时间(UTC): 2009/7/17 8:27:00 
事件 ID: f76cadc46c5c49db96ffeffd22d87e5c 
事件序列: 5 
事件匹配项: 1 
事件详细信息代码: 0 
 
应用程序信息: 
    应用程序域: /LM/W3SVC/5/ROOT-1-128922928153977985 
    信任级别: Full 
    应用程序虚拟路径: / 
    应用程序路径: E:\web\ 
    计算机名: DEJUNERPSERVER2 
 
进程信息: 
    进程 ID: 4592 
    进程名: w3wp.exe 
    帐户名: NT AUTHORITY\NETWORK SERVICE 
 
异常信息: 
    异常类型: InvalidOperationException 
    异常消息: ExecuteScalar 要求已打开且可用的连接。连接的当前状态为正在连接。 
 
请求信息: 
    请求 URL: http://www.****.com/Manager/Module/Order/Declaration/order.aspx
    请求路径: /Manager/Module/Order/Declaration/order.aspx 
    用户主机地址: 121.35.21.233 
    用户: 221,1,linkcoru2008,詹秀如 
    是否已经过身份验证: True 
    身份验证类型: Forms 
    线程帐户名: NT AUTHORITY\NETWORK SERVICE 
 
线程信息: 
    线程 ID: 7 
    线程帐户名: NT AUTHORITY\NETWORK SERVICE 
    是否正在模拟: False 
    堆栈跟踪:    在 System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
   在 System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
   在 System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   在 System.Data.SqlClient.SqlCommand.ExecuteScalar()
   在 DB.Database.Exists(String SqlText, Int32& TempID)
   在 Info.SQLServerDAL.common.Exists(String strTable, String strWhere, Int32& TempID)
   在 Info.BLL.common.Exists(String strTable, String strWhere, Int32& TempID)
   在 WebApp.Manager.Module.Order.Declaration.order.SendOrder(DateTime n)
   在 WebApp.Manager.Module.Order.Declaration.order.Button1_Click(Object sender, EventArgs e)
   在 System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   在 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   在 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
请问网站经常出现这样的问题怎么解决。

解决方案 »

  1.   

    InvalidOperationException 捕获异常
      

  2.   

     异常消息: ExecuteScalar 要求已打开且可用的连接。连接的当前状态为正在连接。 
    是不是你操作数据库那块写的有问题
      

  3.   

    有无启用IIS的 集成 windows身份验证
    连接字符串是否正确
    参考
      

  4.   

     在 DB.Database.Exists(String SqlText, Int32& TempID) 这个方法中 ExecuteScalar 使用的 SqlConnection 被其他方法同时用着,检查你的代码
      

  5.   

    遇到同样问题,想办法解决中,好像是IIS不能与MSSQL正常连接。正在尝试。