Timeout in DataView web part
-
Wednesday, 28 July 2010 12:30 PMGood morning:
I have a brief consultation.
We make a DataView web part in SharePoint Designer to query data from a SQL Server database.
Always worked until one day he began to appear in the log:
"Unhandled Exception: System.Data.SqlClient.SqlException: Timeout expired"
Analyzing the problem, we saw that the SQL query takes 50 seconds. When time is less, the problem does not arise.
Does anyone know how to extend the timeout period?
Thank you very much from now!
Juan Pablo.
surpoint.blogspot.com
geeks.ms/blogs/jpussacq
@jpussacq
HispaPoint: comunidad sharepoint de habla hispana
All Replies
-
Wednesday, 28 July 2010 1:53 PMOwner
Extending the timeout is not necessarily the best way to go since it will impact performance (check SP documentation on how to extend timeout)
I would instead profile the SQL queries and optimize them, additionally you should consider using SQL Server Reporting Services to leverage its caching mechanism and again avoid this type of issue.
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page- Marked As Answer by Christophe FiessingerMicrosoft Employee, Owner Wednesday, 28 July 2010 1:53 PM
- Unmarked As Answer by jpussacqMVP Wednesday, 28 July 2010 2:22 PM
-
Wednesday, 28 July 2010 2:19 PMCristophe:
Thanks for the reply.
We are currently trying to optimize the query, but we need a quick solution because the application is in a production environment.
No documents found on the SP as changing the timeout. Could you give me a link?
From already thank you,
Juan Pablo .-
Juan Pablo.
surpoint.blogspot.com
geeks.ms/blogs/jpussacq
@jpussacq
HispaPoint: comunidad sharepoint de habla hispana -
Wednesday, 28 July 2010 4:17 PM
More info.
More info. This is my connection string:
<SharePoint:SPSqlDataSource runat="server" ID="Tablero" SelectCommand="SELECT * FROM [Tablero]" AllowIntegratedSecurity="False" ConnectionString="Data Source=SRV0;User ID=local1;Password=local1;Initial Catalog=Custom;" ProviderName="System.Data.SqlClient"></SharePoint:SPSqlDataSource>
Do you think that data-retrieval-services-timeout command of stsadm can solve this problem?
Thanks!!
Juan Pablo.
surpoint.blogspot.com
geeks.ms/blogs/jpussacq
@jpussacq
HispaPoint: comunidad sharepoint de habla hispana -
Wednesday, 28 July 2010 5:26 PM
¿has probado a poner el timeout en el Connection String?
connectionString="Data Source=server01;Initial Catalog=Reporting;Persist Security Info=True;User ID=userid;Password=password;Connect Timeout=300"
Alberto Diaz Martin twitter://@adiazcan | http://geeks.ms/blogs/adiazmartin -
Wednesday, 28 July 2010 6:55 PM
Thanks Alberto.
The problem is I need to change the time out without openning SharePoint Designer.
So, I am looking for a parameter in the webconfig or someting like that.
Thanks in advance!
Juan Pablo.
surpoint.blogspot.com
geeks.ms/blogs/jpussacq
@jpussacq
HispaPoint: comunidad sharepoint de habla hispana -
Friday, 30 July 2010 1:59 PMOwner
Again your code is not optimized, from a SQL point of view you should use a stored procedure so the execution plan gets cached, additionnaly never use a SELECT * and instead only select the necessary field required and last but not least implement a WHERE clause to trim the results (plenty of document on MSDN on how to optimize T-SQL queries, time for some basic training :) ).
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page- Marked As Answer by Christophe FiessingerMicrosoft Employee, Owner Wednesday, 6 October 2010 6:19 AM
-
Saturday, 31 July 2010 3:24 AMIt is true that the code is not optimized and the final solution will be to fix that. But at this time can only apply a change in the timeout. For my client policy.
It's not ideal, but sometimes inherit these problems :-)
Thanks anyway!
Juan Pablo.
surpoint.blogspot.com
geeks.ms/blogs/jpussacq
@jpussacq
HispaPoint: comunidad sharepoint de habla hispana