Skip to content

Instantly share code, notes, and snippets.

@Domon
Created December 26, 2015 09:38
Show Gist options
  • Save Domon/2c297281b4a7ef708fe3 to your computer and use it in GitHub Desktop.
Save Domon/2c297281b4a7ef708fe3 to your computer and use it in GitHub Desktop.
From "高雄市政府警察局交通警察大隊" (http://policemail.kmph.gov.tw/page_1_1.aspx).
<!DOCTYPE html>
<html>
<head>
<title>ExecuteReader 必須有開啟與可用的 Connection。連接目前的狀態已關閉。</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
@media screen and (max-width: 639px) {
pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
}
@media screen and (max-width: 479px) {
pre { width: 280px; }
}
</style>
</head>
<body bgcolor="white">
<span><H1>'/' 應用程式中發生伺服器錯誤。<hr width=100% size=1 color=silver></H1>
<h2> <i>ExecuteReader 必須有開啟與可用的 Connection。連接目前的狀態已關閉。</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> 描述: </b>在執行目前 Web 要求的過程中發生未處理的例外狀況。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。
<br><br>
<b> 例外狀況詳細資訊: </b>System.InvalidOperationException: ExecuteReader 必須有開啟與可用的 Connection。連接目前的狀態已關閉。<br><br>
<b>原始程式錯誤:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
行 17: End Try
行 18:
<font color=red>行 19: Using SqlReader As OleDbDataReader = SqlCmd.ExecuteReader()
</font>行 20: While SqlReader.Read()
行 21: Me.caseclass_oldno.Items.Add(New ListItem(String.Format(&quot;{0}.{1}&quot;, SqlReader.Item(&quot;CaseClass_NO&quot;), SqlReader.Item(&quot;CaseClass_NAME&quot;)), SqlReader.Item(&quot;CaseClass_NO&quot;)))</pre></code>
</td>
</tr>
</table>
<br>
<b> 原始程式檔: </b> D:\2014kmph_PoliceMail\page_1_1.aspx<b> &nbsp;&nbsp; 行: </b> 19
<br><br>
<b>堆疊追蹤:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[InvalidOperationException: ExecuteReader 必須有開啟與可用的 Connection。連接目前的狀態已關閉。]
System.Data.OleDb.OleDbConnection.CheckStateOpen(String method) +1807094
System.Data.OleDb.OleDbCommand.ValidateConnection(String method) +30
System.Data.OleDb.OleDbCommand.ValidateConnectionAndTransaction(String method) +24
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +172
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +264
ASP.page_1_1_aspx.page_load(Object sender, EventArgs e) in D:\2014kmph_PoliceMail\page_1_1.aspx:19
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
</pre></code>
</td>
</tr>
</table>
<br>
<hr width=100% size=1 color=silver>
<b>版本資訊:</b>&nbsp;Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.17929
</font>
</body>
</html>
<!--
[InvalidOperationException]: ExecuteReader 必須有開啟與可用的 Connection。連接目前的狀態已關閉。
於 System.Data.OleDb.OleDbConnection.CheckStateOpen(String method)
於 System.Data.OleDb.OleDbCommand.ValidateConnection(String method)
於 System.Data.OleDb.OleDbCommand.ValidateConnectionAndTransaction(String method)
於 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
於 System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
於 ASP.page_1_1_aspx.page_load(Object sender, EventArgs e) 於 D:\2014kmph_PoliceMail\page_1_1.aspx: 行 19
於 System.Web.UI.Control.LoadRecursive()
於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException]: 已發生類型 &#39;System.Web.HttpUnhandledException&#39; 的例外狀況。
於 System.Web.UI.Page.HandleError(Exception e)
於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
於 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
於 System.Web.UI.Page.ProcessRequest()
於 System.Web.UI.Page.ProcessRequest(HttpContext context)
於 ASP.page_1_1_aspx.ProcessRequest(HttpContext context)
於 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
於 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!--
此錯誤頁面可能包含敏感性資料,因為 ASP.NET 是設定成使用 &lt;customErrors mode="Off"/&gt; 顯示詳細資訊錯誤訊息。請考慮在實際執行環境中使用 &lt;customErrors mode="On"/&gt; 或 &lt;customErrors mode="RemoteOnly"/&gt;。-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment