Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 object datasurce time out error

Author  Topic 

akpaga
Constraint Violating Yak Guru

331 Posts

Posted - 2009-08-10 : 10:42:46
hi

i am using an rdlc report thru asp.net report viewer control.
The table adapter that gets filled up with the info of the report is done by executing a stored procedure with date parameters.

sometimes the stored procedure is taking more than 90 sec to excute and then
i am being showed the time out error.

I know how to increase the time out property of sqldatasource but here i am using objectdatasource and i dont know how to do that for objectdatasource.

the coding is done in vb

Please help me as i stuck on this for more than 5 hours

thanks in advance

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-08-11 : 02:27:20
set the timeout property in your code to what you want.

e.g

if your web.config file you can add


<add name="testConn" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=test;Integrated Security=True;Connect Timeout=200" providerName="System.Data.SqlClient"/>

or

Dim conn As SqlConnection = New SqlConnection(_connectionString)
Dim cmd As SqlCommand = New SqlCommand("DELETE FROM ********", conn)
cmd.CommandTimeout = 20
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-08-11 : 02:32:30
However, thinking about the problem again.

I dont think its a good practice to set the timeout property exceed the default, if not your webpage will timeout.

Its best insert the records and run a script which will be oblivious to the user.
Good luck
Go to Top of Page
   

- Advertisement -