By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Getting a Timeout in my SQLConnection

P: n/a
Dom
I'm not sure if this is a question about CSharp, or SQL. But I'll try
here first.

I have several SQL scripts to run, and I'd like to automate the
process, so I am using CSharp and the SqlConnection object and related
objects (such as SqlCommand, etc).

Each SQL script does an INSERT, and it takes quite some time, maybe 20
minutes or more. I know this because each script has been tested in
QA. I pass the exact same SQL script to the SqlCommand, but CSharp
gives me a timeout after a minute or so. The connectionstring uses
"Connection Timeout = 0", but no luck.

Any ideas? BTW, am I right in thinking that CSharp and the SQLxxx
objects are the best approach?

Dom
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You need to set the COMMAND timeout, not the CONNECTION timeout.

Connection Timeout means "Try to talk to the server in this amount of time"

Command Timeout is the amount of time a (usually stored procedure or query)
runs.

"Dom" <do********@gmail.comwrote in message
news:86**********************************@d1g2000h sg.googlegroups.com...
I'm not sure if this is a question about CSharp, or SQL. But I'll try
here first.

I have several SQL scripts to run, and I'd like to automate the
process, so I am using CSharp and the SqlConnection object and related
objects (such as SqlCommand, etc).

Each SQL script does an INSERT, and it takes quite some time, maybe 20
minutes or more. I know this because each script has been tested in
QA. I pass the exact same SQL script to the SqlCommand, but CSharp
gives me a timeout after a minute or so. The connectionstring uses
"Connection Timeout = 0", but no luck.

Any ideas? BTW, am I right in thinking that CSharp and the SQLxxx
objects are the best approach?

Dom

Jun 27 '08 #2

P: n/a
Dom
On Jun 24, 4:02*pm, "sloan" <sl...@ipass.netwrote:
You need to set the COMMAND timeout, not the CONNECTION timeout.

Connection Timeout means "Try to talk to the server in this amount of time"

Command Timeout is the amount of time a (usually stored procedure or query)
runs.

"Dom" <dolivas...@gmail.comwrote in message

news:86**********************************@d1g2000h sg.googlegroups.com...
I'm not sure if this is a question about CSharp, or SQL. *But I'll try
here first.
I have several SQL scripts to run, and I'd like to automate the
process, so I am using CSharp and the SqlConnection object and related
objects (such as SqlCommand, etc).
Each SQL script does an INSERT, and it takes quite some time, maybe 20
minutes or more. *I know this because each script has been tested in
QA. *I pass the exact same SQL script to the SqlCommand, but CSharp
gives me a timeout after a minute or so. *The connectionstring uses
"Connection Timeout = 0", but no luck.
Any ideas? *BTW, am I right in thinking that CSharp and the SQLxxx
objects are the best approach?
Dom- Hide quoted text -

- Show quoted text -
Thanks. Work perfectly.

Dom

Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.