Solved

Dreamweaver MX Calling SQL Server Stored Procedure - 'Timeout Expired' error

Posted on 2004-04-26
5
680 Views
Last Modified: 2012-08-13
Hi

I am a new user - so all help would be most appreciated.

I am calling a SQL Server stored procedure from Dreamweaver MX, and am using VB and ASP.NET.

My queries have been running fine until a user started pulling back large sets of data when the following  error message was displayed after 30 seconds of processing time:

System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable)
at DreamweaverCtrls.DataSet.DoInit()

Whatever I do I can't seem to increase the Timeout value to greater than 30 seconds.

I have checked that the SQL Server Query Timeout limit is set to 0, so it shouldn't be the problem.
I have tried adding <%server.ScriptTimeout=360%> to the top of the web page, to no effect.

I have investigated setting the SqlCommand.CommandTimeout value, but am unsure how it will fit in the MM:DataSet definition:

<MM:DataSet
runat="Server"
id="spResults"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connProgDB2002") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connProgDB2002") %>'
CommandText="dbo.sp_Extract_By_Prog_Post02"
Debug="true"
>

Or am I misunderstanding the problem?
Is it the Connection time which is timing out?

All suggestions most gratefully accepted.
Many thanks

Tony Bailey
0
Comment
Question by:tony_bailey
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:danblake
Comment Utility
Have you had a look at the Administration web-site tool for CF Dreamweaver and the timeouts there to your connection strings ?
(On CF Server -- the timeouts were handled by the CF app Server and changed in the Admin web-site and the default was 30 seconds...)
0
 

Author Comment

by:tony_bailey
Comment Utility
Apologies for not getting back to your reply sooner.

Your suggestion appears to be for ColdFusion Dreamweaver solutions while I am using ASP.NET.

Any ideas for asp.net, as my understanding is that it it quite different.

Many thanks
0
 
LVL 13

Expert Comment

by:danblake
Comment Utility
Even though you are using VB / ASP -- you can still hook in via the CF Connections to the databases.

If you have a ASP.NET connection, what are you using for your connection string a VB/ASP.NET OLEDB Connection or a VB/ASP.NET ODBC Connection ?

By the looks of it you are using CF Connections to your database.
Try adding : ConnectionTimeout = 0 or ConnectTimeout = 0

0
 

Author Comment

by:tony_bailey
Comment Utility

I am connecting using the Dreamweaver utilities, e.g.

<MM:DataSet
runat="Server"
id="spResults"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connDB2002") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connDB2002") %>'
CommandText="dbo.sp_Extract_Post02"

I tried adding a connection timeout parameter to this code, but it was ignored as it doesn't seem to be supported.

The actual connection is made through a web.config file, containing for example the following:
<configuration>
      <appSettings>
            <add key="MM_CONNECTION_HANDLER_connDB2002" value="sqlserver.htm" />
            <add key="MM_CONNECTION_STRING_connDB2002" value="Persist Security Info=False;Data Source=(local);Initial Catalog=ProgDB;User ID=;Password=;Trusted_Connection=Yes" />
            <add key="MM_CONNECTION_DATABASETYPE_connDB2002" value="SQLServer" />
            <add key="MM_CONNECTION_SCHEMA_connDB2002" value="" />
            <add key="MM_CONNECTION_CATALOG_connDB2002" value="" />
      </appSettings>
</configuration>

Many thanks for all your advice

Tony

0
 
LVL 13

Accepted Solution

by:
danblake earned 500 total points
Comment Utility
Modify this line:

MM_CONNECTION_STRING_connDB2002" value="Persist Security Info=False;Data Source=(local);Initial Catalog=ProgDB;User ID=;Password=;Trusted_Connection=Yes; Connect Timeout = 6000"

/*Connect Timeout or Connection Timeout will then be placed as 6000 seconds, 0 is an infinite wait*/
--> This is the time to grab a connection to the server (if you can connect, we need to modify the following):

Connection Lifetime 0 --> This is used to define how long the connection stays alive.
MM_CONNECTION_STRING_connDB2002" value="Persist Security Info=False;Data Source=(local);Initial Catalog=ProgDB;User ID=;Password=;Trusted_Connection=Yes; Connect Timeout = 6000; Connect Lifetime = 0"
/* 0 = Never timeout, 60 would be 60 seconds*/

Looks like it should do the trick.

If connecting via the Dreamweaver utilities, you should be able to modify the DW Admin page (as I aluded to earlier -- to modify DB2002 as the connection that you have to modify and change the connect timeout / max running time).
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now