ExecuteScalar requires an open and available Connection. The connection's current state is closed.

 


ExecuteScalar requires an open and available Connection. The connection's current state is closed.

Server Error in '/' Application.

ExecuteScalar 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: ExecuteScalar requires an open and available Connection. The connection's current state is closed.

Source Error:


Line 57:             {
Line 58: 
Line 59:                 dtAds = objDb.ReturnDataTableStoredProc(new Hashtable(), "selectAds");
Line 60:             }
Line 61:             finally

Source File: c:\hostingspaces\kishanInterview\interviewmaterial.com\wwwroot\Data-Warehouse\What-are-the-steps-to-build-the-datawarehouse.aspx    Line: 59

Stack Trace:


[InvalidOperationException: ExecuteScalar requires an open and available Connection. The connection's current state is closed.]
   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +2540609
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +119
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +65
   System.Data.SqlClient.SqlCommand.ExecuteScalar() +189
   DAL.dbClass.LogErrorsInDB(String sMsg) in C:\KK\Work\InterviewMaterial\InterviewMaterialProject\interviewmaterial\DAL\dbClass.cs:139
   DAL.dbClass.ReturnDataTableStoredProc(Hashtable hs, String StorProcName) in C:\KK\Work\InterviewMaterial\InterviewMaterialProject\interviewmaterial\DAL\dbClass.cs:554
   ASP.data_warehouse_what_are_the_steps_to_build_the_datawarehouse_aspx.showAds() in c:\hostingspaces\kishanInterview\interviewmaterial.com\wwwroot\Data-Warehouse\What-are-the-steps-to-build-the-datawarehouse.aspx:59
   ASP.data_warehouse_what_are_the_steps_to_build_the_datawarehouse_aspx.Page_Load(Object sender, EventArgs e) in c:\hostingspaces\kishanInterview\interviewmaterial.com\wwwroot\Data-Warehouse\What-are-the-steps-to-build-the-datawarehouse.aspx:50
   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.4770.0