473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SqlException: Timeout expired

Hi,
I have an unusual error,

"System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding......and so on "
I have never seen such an error.

Yes, i do agree that the SP takes anywhere b/w 2-5 min to return data and i
have no "connection timeout parameter" set in my web.config
the thing which baffles me is that this exception is thrown at about 1 min
range

please advice,
Stephen
Nov 19 '05 #1
4 1858
Is this not a command timeout opposed to a connection timeout?

There is a timeout on the command object that you can set.
"Stephen Noronha" <st********@hotmail.com> wrote in message
news:u6**************@TK2MSFTNGP09.phx.gbl...
Hi,
I have an unusual error,

"System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding......and so on "
I have never seen such an error.

Yes, i do agree that the SP takes anywhere b/w 2-5 min to return data and i have no "connection timeout parameter" set in my web.config
the thing which baffles me is that this exception is thrown at about 1 min
range

please advice,
Stephen

Nov 19 '05 #2
Hi Landley,

here is what I am doing?
Private function GetRecords(ByVal startDate As Date, ByVal endDate As Date,
ByVal Code1 As String, ByVal Code2 As String) As DataTable
Dim cmd As New SqlCommand("stp_GetRecords", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As New SqlDataAdapter(cmd)
Dim dt As New DataTable
Try
Dim pms As SqlParameterCollection = cmd.Parameters
pms.Add("@begdate", SqlDbType.SmallDateTime).Value = startDate
pms.Add("@enddate", SqlDbType.SmallDateTime).Value = endDate
pms.Add("@code1", SqlDbType.VarChar, 6).Value = Code1
pms.Add("@code2", SqlDbType.VarChar, 6).Value = Code2

da.Fill(dt) <---- Fails here

If dt.Rows.Count > 0 Then
GetRecords = dt

Else
GetRecords = Nothing

End If

Catch ex As Exception
'Throw New Exception
lblError.Text = ex.ToString

End Try
Return GetRecords

End Function

It gives me a timeout error while its filling the datatable,
Please advice,
Stephen
Nov 19 '05 #3
Stephen,
I think your SP is timing out because of the remote conection
timeout set on your database server. Try the following steps in your
SQLServer.

1)In Object Explorer, right-click a server and select Properties.

2)Click the Connections node.

3)Under Remote server connections, in the Remote query timeout box,
type or select a value from 0 through 2,147,483,647 to set the maximum
number seconds for SQL Server to wait before timing out.

Hope this helps......

Regards,
Pavan.

Nov 19 '05 #4
SqlCommand has a 1 minute timeout by default. set it higher. you will then
have to bump up the page timeout. though 2-3 minutes is way too long, the
broser/proxy may give up. certainty the user will.

-- bruce (sqlwork.com)
"Stephen Noronha" <st********@hotmail.com> wrote in message
news:u6**************@TK2MSFTNGP09.phx.gbl...
Hi,
I have an unusual error,

"System.Data.SqlClient.SqlException: Timeout expired. The timeout period
elapsed prior to completion of the operation or the server is not
responding......and so on "
I have never seen such an error.

Yes, i do agree that the SP takes anywhere b/w 2-5 min to return data and
i
have no "connection timeout parameter" set in my web.config
the thing which baffles me is that this exception is thrown at about 1 min
range

please advice,
Stephen

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Silvia | last post by:
I have a application web and when execute this for a long time generated this error: Server Error in '/RAIMServer' Application. -----------------------------------------------------------...
4
by: hb | last post by:
Hi, I got the "System.Data.SqlClient.SqlException: Timeout expired. " error on my web application while saving some data. Would you please tell me how to change the settings in SQL Server...
4
by: Nick | last post by:
Hi I am a little stuck. I have a web app which uses cookieless session management. I would like to inform a user when their session has ended but cannot work out how to implement. I thought...
4
by: Nevyn Twyll | last post by:
I've been working on an asp.net application and everything's been great. But suddenly, whether I'm tyring to use a database on my own machine, or on my server, I'm getting a timeout when trying to...
3
by: Matt | last post by:
I'm having an issue with returning a large amount of data into a dataset. When the query returns thousands of lines of data (in Query Analyzer it can take 2 minutes) I receive the following error:...
0
by: Ersin Gençtürk | last post by:
we are getting : System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period...
0
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
3
by: rn5a | last post by:
I am working on Win2K Pro (SP4) with P4 2.80GHz, 256MB RAM & 20GB hard disk (IIS5.0). I use Visual Web Developer 2005 Express Edition to create & edit ASP.NET apps. Whenever I log in to my m/c....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.