473,397 Members | 2,099 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,397 software developers and data experts.

SQL Server timeout error while executing stored procedure

Platform: Windows 2003 Server (MS SQL Server 2003 SP3)
Language: C#

Problem:

My stored procedures times out randomly, some proces works fine when using
them from C#, and some generate SqlException which states that the server
has timed out. The problem isn't in server, neither in stored procedures
because they work fine in Sql Server's enterprise manager, but when calling
from code they are slow and take about 60 seconds before executing.

Also the click here is that when first SP fails and you run the exact same
SP again, it runs smoothly and do not generate any kind of exception.

I also use ServicedComponents, and the class which handles the database is
inherited from ServicedComponent. In case if i raise the timeout to about 60
or 90 seconds, it goes through but throws COMException, which states that
transaction has failed.

i call the sp like

SqlConnection con = new SqlConnection(constr);
con.open();
SqlCommand cmd = new SqlCommand("StoredProcName", con);
cmd.CommandType = CommandType.StoredProcedure;

<Some parameter assigning>

reader = cmd.ExecuteReader(); <- Generates timeout

while(reader.Read())
{
ret.add
}

Also samekind of problem is when i try to insert some data with stored
procedure. There is about 50 stored procedures in the database, and some of
them work like these two which generates the timeout, but they work fine.

Thank you for respones

Ville Huovinen
Nov 16 '05 #1
1 12060
Hi Ville
You didn't specify how you set the name of the stored procedure to the
command object; try to give the full qualified name of the stored procedure
to the command text property. Try also to see the status of your
connections to the DB from the enterprise manager, process info.

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2

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

Similar topics

3
by: David Morgan | last post by:
Hello In my ASP page I am trying to ascertain whether a randomly generated ID starts with certain characters that are not allowed or has been used before. When the SQL statement for latter is...
2
by: Yves Touze | last post by:
Hi All, I'm trying to migrate from SQL Server 7.0 to SQL Server 2000. I've got some ASP page which call VB components that retrieve shaped recordsets from SQL Server using the MSDATASHAPE...
0
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the...
9
by: John | last post by:
I have a single server running SQL Server 2000 sp3a, and acting as a ASP.NET webserver (.net 1.1 sp1). W2k sp4. Dual Xeon processor, 2 gigs RAM. Everything works fine, but sometimes when I...
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
1
by: Ron | last post by:
Hi, I had a stored procedure on SQL 2000 server to run calculation with large amount of data. When I called this stored procedure via System.Data.SqlClient.SqlCommand on production, i got error...
6
by: archana | last post by:
Hi all, I am executing one stored procedure in windows service. I set sqlcommad's CommandTimeout to 432000 which means 5 days timeout. Still after 11th hour i am getting timeout. I am not...
4
by: Mikael.Bergstrand | last post by:
I can't execute my stored procedure from .NET (I think it might be because the stored proc has joins in it via linked servers). I get timeout error from .NET MyBase.connString ="Integrated...
2
by: =?Utf-8?B?Q29ubnVsbA==?= | last post by:
What could the possible reason be for obtaining "timeouts" when executing a stored procedure from my application? If I execute the specific stored procedure in Query Analyzer I do not get any...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.