sql timeout
-
Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance
He who laughs last is a bit on the slow side
-
Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance
He who laughs last is a bit on the slow side
I'm sure I'm not the best expert on this, but the first two things I would do are: 1) double check your connection string in the app 2) check out the resources that your app is using, potentially it could be hogging everything so that sql server runs more slowly and times out hope those help or that someone else can give you the real low down ~A
-
I'm sure I'm not the best expert on this, but the first two things I would do are: 1) double check your connection string in the app 2) check out the resources that your app is using, potentially it could be hogging everything so that sql server runs more slowly and times out hope those help or that someone else can give you the real low down ~A
Thanx for the reply, I know the connection is fine, when I step through it, it loads all the values into my dataset, then I loop through the dataset and populate a listview. The first time I run the app it will populate the listview with lets say 20 entries, the second time it will populate the list view with 80 entries. The problem being that its with the exact same operation and I can't think that the app uses that much resources, or should I say I rather hope not. Once again many thanx for the quick reply.
He who laughs last is a bit on the slow side
-
Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance
He who laughs last is a bit on the slow side
I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant
Command
object. -
I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant
Command
object.J4amieC wrote:
How to get answers to your questions[^]
I'm sorry if I posted this under the wrong discussion. Seeing as I thought it wasn't a sql problem I thought it might be a problem within my code. I removed the timeout on the connection, but still recieve the timeout error. I will look into the Command timeout.
J4amieC wrote:
Command timeout which is set on the relevant Command object.
With that I asume you are talking about the sql command object, such as the select statement.? Many thanx for the reply
He who laughs last is a bit on the slow side
-
I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant
Command
object.The connection previously were created using sa, the sql system administrator. I changed that to a different user to login into the database, and from there it all went wrong, can it be anything with that, the user I created also has all adminitrator rights. Unfortunatily I'm not much of a sql fundu, still have alot to learn.
He who laughs last is a bit on the slow side