Avatar of bnrtech
bnrtech
 asked on

Timeout Expired SQL Exception

Hello,

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
                .Connection.Open()
                .ExecuteNonQuery()
                .Connection.Close()
            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?
.NET ProgrammingMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
Tyug

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Tyug

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck