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...
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.
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.
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.
You have to set .CommandTimeout
on the command. It doesn't work if you set it in the connection string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With