I'm developing a Report Service and while excecuting the query getting :
An error has occurred during report processing. Exception has been thrown by the target of an in开发者_高级运维vocation. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I know that on the SQL server the query running for a minute ot two.
I setted the Connection string in the web.config like that:
"Data Source=servA;Initial Catalog=myPortal;Integrated Security=True;connection timeout=1000"
It didn't work for me.
You can specify the connection timeout
in the connection string, but that only says how long it should wait for a connection to succeed,
What you're looking for is the command timeout
. That specifies how long SSRS will wait on a particular query to succeed. If I remember right, you can change this in each report in the command timeout
setting? Or maybe it was called execution timeout
?
How I got this to work in using BIDS 2008:
- In the "Report Data" pane, right click on the Dataset and select "Dataset Properties".
- At the bottom of the "Query" tab inside the "Dataset Properties" modal window, set the value of the "Timeout (in seconds
See this Link.
After you finished the design of Dataset.xsd, find in Dataset.Designer.cs the following code:
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection {
get {
if ((this._commandCollection == null)) {
this.InitCommandCollection();
}
return this._commandCollection;
}
}
and change it to :
protected global::System.Data.SqlClient.SqlCommand[] CommandCollection
{
get
{
if ((this._commandCollection == null))
{
this.InitCommandCollection();
_commandCollection[0].CommandTimeout = 0;
}
_commandCollection[0].CommandTimeout = 0;
return this._commandCollection;
}
}
Build your program and enjoy.
精彩评论