Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Timeout Expired SQL Exception

Avatar of bnrtech
bnrtech asked on
.NET ProgrammingMicrosoft SQL Server 2005
2 Comments1 Solution370 ViewsLast Modified:

I have a form within a Visual Basic application that executes a stored procedure (housed in sql 2000) using something like the following block of code

Using connection As New SqlClient.SqlConnection(Global.Application.My.Settings.SQLServer)
            Dim MySTPObject As New SqlClient.SqlCommand("StoredProcedureName", connection)
            With MySTPObject
                .CommandType = CommandType.StoredProcedure
            End With
        End Using

The code fails to finish and causes an sqlexception with a timeout expired message. The stored procedure takes a while to finish so I have tried setting the connection timeout property for the connection string in use but regardless of what I enter I receive a timeout error after a minute or so. I have also verified that the remote query timeout setting within the sql server is set to unlimited (0). Are there any other timeout settings I could be missing or perhaps even another cause for this error?