C# Microsoft报表(rdlc)阻止将数据保存到SQL Server数据库

C# Microsoft报表(rdlc)阻止将数据保存到SQL Server数据库,c#,asp.net,sql,sql-server,entity-framework,C#,Asp.net,Sql,Sql Server,Entity Framework,我们在ASP.NET Web Forms应用程序(在报表查看器控件上)中有一个复杂的rdlc报表,它在报表生成过程中会阻止表中的所有行。在报表创建过程中,如果我们尝试将数据(使用EF 5.0)保存在报表获取数据的同一个表中,则会出现以下异常: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the se

我们在ASP.NET Web Forms应用程序(在报表查看器控件上)中有一个复杂的rdlc报表,它在报表生成过程中会阻止表中的所有行。在报表创建过程中,如果我们尝试将数据(使用EF 5.0)保存在报表获取数据的同一个表中,则会出现以下异常:

 System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> 
 System.ComponentModel.Win32Exception: The wait operation timed out

--- End of inner exception stack trace ---

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters)
...
在报告创建期间,我们尝试使用read uncommitted隔离级别(如[1]中所述),但这没有帮助。我们能做什么


[1] -

您可以尝试将
与(NOLOCK)
一起添加到SSRS查询中每个FROM语句的末尾:

SELECT * 
FROM table1 WITH(NOLOCK)

但是,这相当于使用
读取未提交的
,因此您可能看不到任何差异。

在调试和分析之后,似乎报表生成会阻止用户的应用程序。实际上,长请求(在报表查看器中创建报表)会阻止应用程序。甚至连数据库都没有。