Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve TimeOut Expired Problem?

Using SQL Server 2005 and VB6

When I executing for yearly data or more than 3 months' data, it is showing "Timeout Expired" error. It is not executing completely.

My Connection String

ConnectionString = "Provider=SQLOLEDB.1;" & _
    "Persist Security Info=False; " & _
    "User ID=" & Settings.SQL_Username & _
    "; Password = " & Settings.SQL_Password & "; " & _
    "Initial Catalog=" & Settings.SQL_DatabaseName & ";" & _
    "Data Source=" & Settings.SQL_ServerAddress

How do I solve this problem?

Plz...

like image 333
Gopal Avatar asked Oct 13 '09 14:10

Gopal


People also ask

How do I fix SQL Server timeout expired error?

If you encounter a connection-timeout error, follow the steps: Increase the connection-timeout parameter. If you use an application to connect to SQL Server, increase the relevant connection-timeout parameter values and check whether the connection eventually succeeds.

What causes SQL timeout?

SQL Server will typically show you connection timeouts or operation (query) timeouts. These values are set by the client connecting to the SQL Server. An operation timeout occurs when a command takes too long to complete, and the client raises an error.

How do I change timeout in SQL?

Using SQL Server Management StudioIn Object Explorer, right-click a server and select Properties. Click the Connections node. Under Remote server connections, in the Remote query timeout box, type or select a value from 0 through 2,147,483,647 to set the maximum number seconds for SQL Server to wait before timing out.


1 Answers

You have to set .CommandTimeout on the command. It doesn't work if you set it in the connection string.

like image 110
Dinah Avatar answered Oct 10 '22 07:10

Dinah