SQL timing out

A

AFeris

I am using C# to connect and extract data from an SQL database. However, on
large databases (>1,000,000 records), I keep getting a time-out error
("Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.") when trying to fill a DataSet
(empty/new). This occurs about 3 minutes into the calculations.

Select Command: "SELECT * FROM db_information WHERE ([Sales Date] <=
CONVERT(DATETIME, '2003-01-31 00:00:00', 102))".

Connect string: "data source=MyServer;initial catalog=MyDataBase;integrated
security=SSPI;persist security info=False;workstation id=Laptop;packet
size=4096;Connect Timeout=3600"

Procedure: "ConnectionCheckForData (CheckforData())."

Source: ".Net SqlClient Data Provider"

The server timeout default is 0, for unlimited.

Any ideas on what is causing the timeout error, and what changes are
necessary to fix?

Thanx,
Allen Feris
The DataSol Group, Inc.
 
N

NaraendiraKumar R. R.

Have you tried increasing the command timeout property -
SqlCommand.CommandTimeout().

-Naraen
 

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