Server Error in '/' Application.

The connection was not closed. The connection's current state is open.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection was not closed. The connection's current state is open.

Source Error:


Line 146:        objCommand.Connection = objConnect
Line 147:        objCommand.CommandText = strSelect
Line 148:        objConnect.Open
Line 149:		iCountRecArticles = objCommand.ExecuteScalar()
Line 150:		'response.Write(objCommand.ExecuteScalar())

Source File: C:\Inetpub\vhosts\pthaigastro.org\httpdocs\Posting.aspx    Line: 148

Stack Trace:


[InvalidOperationException: The connection was not closed. The connection's current state is open.]
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +14
   System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +17
   System.Data.OleDb.OleDbConnection.Open() +42
   ASP.posting_aspx.CountRead() in C:\Inetpub\vhosts\pthaigastro.org\httpdocs\Posting.aspx:148
   ASP.posting_aspx.Page_Load(Object Sender, EventArgs E) in C:\Inetpub\vhosts\pthaigastro.org\httpdocs\Posting.aspx:72
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209