connectionString="Data Source=########;Initial Catalog=DowntimeD51;Persist Security Info=True;User ID=#######;Password=########;Connection Timeout=120;Encrypt=False;TrustServerCertificate=False;Network Library=dbmssocn"

I have the above connection string in a vb windows application , This is part of my app config file.

I then have a number of table adapters for connecting my business logic to the database , One of the queries inparticular is a pretty large one and requires extra time to complete however the connection is getting a timeout error. When I checked the adapter connection with Dim connection2 As Int32 = Adapter1.Connection.ConnectionTimeout This shows the connection time out to be 120 seconds but the timeout is still occuring after 30 seconds.

I was wondering if there was some inheritance rules i am missing or something hopefully someone will notice something i am missing .

Recommended Answers

All 2 Replies

Did you set CommandTimeout?

Dim command As New SqlCommand(sqlQuery, _Database.Connection)
command.CommandTimeout = 10 'some value

Dim command As New SqlCommand(sqlQuery, _Database.Connection)
command.CommandTimeout = 10 'some value

I Tried Adapter1.Connection.CreateCommand.CommandTimeout = 120 but again this is not working , I have checked in my settings designer and the time out comand is set for 120 but is still timeing out after 30 seconds . I am not sure what else to do ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.