Hi,
i developed one web application using visual studio 2005. before deployment it runs perfectly. when i deployed and try to access pages, i get the following errors. i am using sql server 2005 management studio.what i have to do for avoiding this problem. plz help me.
Server Error in '/' Application.
--------------------------------------------------------------------------------
ExecuteReader requires an open and available Connection. The connection's current state is closed.
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: ExecuteReader requires an open and available Connection. The connection's current state is closed.
Source Error:
Line 43: {
Line 44: dbc = new OleDbCommand(query, db);
Line 45: mr = dbc.ExecuteReader();
Line 46: return mr;
Line 47: }
Source File: c:\Inetpub\wwwroot\App_Code\ClassLeave.cs Line: 45
Stack Trace:
[InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.]
System.Data.OleDb.OleDbConnection.CheckStateOpen(S tring method) +1061115
System.Data.OleDb.OleDbCommand.ValidateConnection( String method) +22
System.Data.OleDb.OleDbCommand.ValidateConnectionA ndTransaction(String method) +15
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) +51
System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior behavior) +111
System.Data.OleDb.OleDbCommand.ExecuteReader() +6
ClassLeave.select(String query) in c:\Inetpub\wwwroot\App_Code\ClassLeave.cs:45
Login.btnLogin_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\Default.aspx.cs:70
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42