Connection String - how to include timeout?

D

Doug

Hi,

I am having a problem creating a connection string in DotNet. Here is
an example below:

"Integrated
Security=SSPI;database=MyDatabase;server=MySqlServer;Connect
Timeout=60"

The problem is in the timeout setting. I am running a query using this
connection string and it is timing out at 30 seconds, it does not go to
the 60 seconds. I figured it must be because it's a connection timeout
setting I've used above and not an actual query timeout setting.
However, I cannot determine how to set a query timeout setting in my
connection string. Is there a way to do this?
 
M

Marina Levit [MVP]

This specifies the connection timeout - meaning how long to try to connect
before giving up.

Not related to query timeout. You set that on the command object itself.

By the way, this question has been asked dozens and dozens of times. A quick
google search would have probably give you your answer.
 
D

Doug

Thanks for the answer! The command object fixed my issue.

As far as the google search goes, I tried that first. However, it's
not always easy to determine the actual search parameters for what you
are looking for. Searching with what I knew I was unable to find the
answer.
 
W

William \(Bill\) Vaughn

Increasingly, I'm finding that Google provides too much (irrelevant)
information--even when you do know the right keywords. Perhaps books have a
purpose as well. It really depends on what your time is worth... ;) $34.50
for a 1100 page book might be a pretty good deal after all if it has the
answers and they are easy to find.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
 
G

Garry

I don't agree.

If one is looking for a solution to a specific problem encountered while
writing code, Google seems the best solution by far. Just get the search
parameters adjusted and you have a good chance of finding what you want.

If you want to learn a subject, reading a buk wood be a better choice.
However, not all books are well written and many are orientated to cashing
in on a temporary period where accurate info on a new product is not
available.

$35 is not a lot to spend if it supplies your grounding in whatever you want
to extend your horizons. If the book doesn't supply this then it can simply
be a waste of money.

Google doesn't cost anything and you can certainly learn a lot 'on the way'

Garry
 
W

William \(Bill\) Vaughn

Actually, I agree. That's why I wrote the latest HHG the way I did. It's
full of "foundational" content that's not time-sensitive. Sure, it talks
about the new features in VS and SS 2005, but it has hundreds of pages
(probably over half) that won't "time-out" when the next version of VS or SS
arrives... ;)

Yes, just be careful with Google. Since not all articles have the date
published or any indication if it's still a correct solution...

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
-----------------------------------------------------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top