none
[VS 2008 - ReportViewer] Random error on DataReader: connection state is connecting RRS feed

  • Question

  • I have a very small application using linq and the ReportViewer. On random base the report doesn't display (the frequency change with great amount on different installation: XP, 2003 server) givin the error on subject.

    DataReader needs an open connection: connection state is connecting

    or

    The command is associated with a open DataReadr that needed to be closed

    (I'm translating the error messages fro italian, so the may look different in english).

    The stacktrace is attached below.

    The overall application with the same datacontext, the same linq queries and so on works perfectly. Only the reports have those problems.

    I've try to run the report with a clean form not activated by other form, the problem still arises.

    The database is SQL SERVER EXPRESS 2005 with the latest SP3. The .net framework 3.5 is SP1.

    Any idea?

    Thank you Satollo.

    The  stacktrace:

    Microsoft.Reporting.WinForms.LocalProcessingException: Errore durante l'elaborazione locale del report. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: Errore durante l'elaborazione del report. ---> System.InvalidOperationException: Al comando è già associato un DataReader aperto, che deve essere chiuso.
       in System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
       in System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
       in System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
       in System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       in System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       in System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       in System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
       in System.Data.Common.DbCommand.ExecuteReader()
       in System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
       in System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
       in System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
       in System.Data.Linq.DataQuery`1.System.Collections.IEnumerable.GetEnumerator()
       in Microsoft.Reporting.DataEnumerableReader..ctor(IEnumerable dataEnumerable)
       in Microsoft.Reporting.DataSetProcessingExtension.CreateDataReaderFromObject(Object dataSourceValue)
       in Microsoft.Reporting.DataSetProcessingExtension..ctor(IEnumerable dataSources, String dataSetName)
       in Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeControlDataSetNode.RunDataSetQuery()
       in Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeReportDataSetNode.FirstPassInit()
       in Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeDataSetNode.FirstPassProcess(Boolean& closeConnWhenFinish)
       in Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeReportDataSetNode.Process()
       in Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeDataSetNode.ProcessConcurrent(Object threadSet)
    Monday, March 2, 2009 5:05 PM