Database Exception

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi,
I am trying to run the project in my local machine and it is throwing the below error. The same project is executed fine earlier.
Please help me to fix this.

System.Data.EntityCommandExecutionException was unhandled by user code
  Message=An error occurred while executing the command definition. See the inner exception for details.
  Source=System.Data.Entity
  StackTrace:
       at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
       at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
       at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
       at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at NopSolutions.NopCommerce.BusinessLogic.Manufacturers.ManufacturerService.GetProductManufacturersByProductId(Int32 productId)
       at NopSolutions.NopCommerce.BusinessLogic.Products.Product.get_ProductManufacturers()
       at NopSolutions.NopCommerce.BusinessLogic.Data.NopObjectContext.get_Products()
       at NopSolutions.NopCommerce.BusinessLogic.Products.ProductService.GetProductById(Int32 productId)
       at NopSolutions.NopCommerce.Web.Modules.ProductPrice2Control.BindData() in C:\Prasad Kalam\eConceptInfo\July18\NopCommerceStore\Modules\ProductPrice2.ascx.cs:line 54
       at NopSolutions.NopCommerce.Web.Modules.ProductPrice2Control.OnPreRender(EventArgs e) in C:\Prasad Kalam\eConceptInfo\July18\NopCommerceStore\Modules\ProductPrice2.ascx.cs:line 47
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: System.InvalidOperationException
       Message=There is already an open DataReader associated with this Command which must be closed first.
       Source=System.Data
       StackTrace:
            at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
            at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
            at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
            at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
            at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
            at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
            at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
            at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
            at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
       InnerException:


Thanks,
Prasad.
12 years ago
Here is the info about my SQL server.

Microsoft SQL Server Management Studio            10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Analysis Services Client Tools            2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC)            6.1.7600.16385 (win7_rtm.090713-1255)
Microsoft MSXML            3.0 4.0 6.0
Microsoft Internet Explorer            8.0.7600.16385
Microsoft .NET Framework            2.0.50727.4961
Operating System            6.1.7600

Please reply me if you have any suggestions / solutions for this
12 years ago
Got the solution. Forget to mention the "MultipleActiveResultSets=True" property in connectionstring.

Thanks,
Prasad
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.