Sql Server Timeout Problem

  • Thread starter Thread starter BBC1009
  • Start date Start date
B

BBC1009

I have an application connected to an overseas sql-server using port 1433.
But recently it always timeout the connection. Any solution to avoid
this??? I am using the VB.net Windowed Form with .net 2002, SQL-Sever 2000
Enterprise


Thanks!
 
with you connection object you can set the timeout higher.
you could also make sure you can hit port 1433 before you try to create the
connection.

or where you declare your connection you can put it in a try catch statement
and loop until you have a connection.
 
Do you meant that set the "connection timeout" to higher? I already set it
to 600 but still time-out.

I delcare the connection on the first login form and keep open thru the
program. Is it a problem?
 
My connection string is :

Data Source=xxxx.vicp.net;user Id=sa;password=abc;Initial
Catalog=ffs;Connect Timeout=600
 
Hi

I would only open the connection if you need it, because in .net the
connections get pooled, so I'd advise not to keep the connection open all
the time, I think this could cause a timeout, does the timeout occure when
you first want to connect or after a couple of minutes if the program is
already open?

Greetz Peter
 
When it connects to the local database, it should be no problem. The
problem only occur when connecting to the overseas server ie
Hongkong-->China.
We tried open the connection each time before but the performance is far
away from keep it open.
The first connect has no problem (login process) but it timeout when perform
a query or execute a sql.

Thanks
 
BBC1009 said:
I have an application connected to an overseas sql-server using port 1433.
But recently it always timeout the connection. Any solution to avoid
this??? I am using the VB.net Windowed Form with .net 2002, SQL-Sever 2000
Enterprise


Thanks!
Have you considered Queued Components? If your app doesn't want to wait
for the overseas connection, a local queue may add the fault tolerance
you need.
 
How fast is the line to china? Maybe it isn't fast enough for a big query,
but it's fast enough for small selects
just my toughts...

Greetz
 
You can also specify the sqlcommand timeout,
SqlCommand.CommandTimeout

greetz Peter
 
Back
Top