PDA

View Full Version : مبتدی: خطا ی در لود وب سایت ،There is already an open DataReader associated with this Command which must be



akbarnayebi
سه شنبه 01 مهر 1393, 15:36 عصر
باسلام خدمت دوستان گلم
من یه سایتی به آدرس http://shadab.net/ درست کردم و دربعضی مواقه یکی در میان وقتی صفحه را لود میکنم خطای زیر را نمایش میدهد
خطا:

Server Error in '/' Application.

ExecuteReader requires an open and available Connection. The connection's current state is connecting.

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 connecting.

Source Error:


Line 13: {
Line 14: //var info = Library.Db.tblDescriptions.FirstOrDefault(p => p.id.Equals(1));
Line 15: var info = Library.SelectDescription(1).FirstOrDefault();
Line 16: if (info == null) return;
Line 17: Page.Title = info.title;

Source File: c:\hostingspaces\shadab.net\shadab.net\wwwroot\Def ault.aspx.cs Line: 15

Stack Trace:


[InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is connecting.]
System.Data.SqlClient.SqlConnection.GetOpenConnect ion(String method) +5363464
System.Data.SqlClient.SqlConnection.ValidateConnec tionForExecute(String method, SqlCommand command) +38
System.Data.SqlClient.SqlCommand.ValidateCommand(S tring method, Boolean async) +155
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +82
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior, String method) +137
System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior behavior) +41
System.Data.Common.DbCommand.ExecuteReader() +12
System.Data.Linq.SqlClient.SqlProvider.Execute(Exp ression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) +385
System.Data.Linq.SqlClient.SqlProvider.ExecuteAll( Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +118
System.Data.Linq.SqlClient.SqlProvider.System.Data .Linq.Provider.IProvider.Execute(Expression query) +342
System.Data.Linq.DataQuery`1.System.Linq.IQueryPro vider.Execute(Expression expression) +58
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +251
Default.Page_Load(Object sender, EventArgs e) in c:\hostingspaces\shadab.net\shadab.net\wwwroot\Def ault.aspx.cs:15
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(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

ممنون میشم کمکم کنید

fakhravari
سه شنبه 01 مهر 1393, 20:05 عصر
در یکی از متد های شما ExecuteReader بسته نشده است.
Line 13 برسی کنید.

takparz
سه شنبه 01 مهر 1393, 23:13 عصر
reader.close();