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 25:         {
Line 26: 
Line 27:             SqlVariable.con.Open();
Line 28:             SqlVariable.com = new SqlCommand("select * from [Mdestination] where Name='Darjeeling'", SqlVariable.con);
Line 29:             SqlVariable.com.CommandType = CommandType.Text;

Source File: g:\pleskvhosts\technoimagine.com\www.trekkinginsikkims.com\Darjeeling.aspx.cs    Line: 27

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) +20
   System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +92
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +219
   System.Data.SqlClient.SqlConnection.Open() +101
   Darjeeling.Page_Load(Object sender, EventArgs e) in g:\pleskvhosts\technoimagine.com\www.trekkinginsikkims.com\Darjeeling.aspx.cs:27
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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