Re: Time out errors
- From: "Rob" <robc1@xxxxxxxxx>
- Date: Sun, 29 Jul 2007 18:19:07 -0400
Hi,
The code goes something like this.... I am opening, closing, disposing,
then opening, closing, disposing, again.... maybe as many as 10 times in a
row back to back.... could this be a problem ?
cnn = New SqlConnection(strConnection)
cnn.Open
Dim cmd as New SqlCommand
cmd = cnn.CreateCommand
' code to execute a stored proc
cmd.ExecuteNonQuery()
cnn.close()
cnn.Dispose()
cmd.Dispose()
cmd=nothing
cnn = New SqlConnection(strConnection)
cnn.Open
Dim cmd2 as New SqlCommand
cmd2 = cnn.CreateCommand
' code to execute a stored proc
cmd2.ExecuteNonQuery()
cnn.close()
cnn.Dispose()
cmd2.Dispose()
cmd2=nothing
Thanks !
"Mr. Arnold" <MR. Arnold@xxxxxxxxxx> wrote in message
news:O3zckLi0HHA.4816@xxxxxxxxxxxxxxxxxxxxxxx
"Rob" <robc1@xxxxxxxxx> wrote in message
news:Mqudnf6l-_FENjHbnZ2dnUVZ_rSinZ2d@xxxxxxxxxxxxxx
VB.net 2005 Windows app... makes calls to 2005 SQL server... sometimes I
get a Timeout error, other times I do not...
What is the best way to handle timeout errors ?
1. How to increase the timeout - from the app it appears that the
property is "read -only" ? So must it be set at the server from within
SQL Management studio ? If so how ?
Maybe, you have too many connections open, because things are not being
closed properly. The application cannot get another connection and is
timing out, because of existing open connections that were never disposed.
2. How would you implement a "try again" method ?
Maybe, you don't want to try again and find out what the problem is,
because it shouldn't be happening.
.
- Follow-Ups:
- Re: Time out errors
- From: Michel Posseth [MCP]
- Re: Time out errors
- From: Mr. Arnold
- Re: Time out errors
- References:
- Time out errors
- From: Rob
- Re: Time out errors
- From: Mr. Arnold
- Time out errors
- Prev by Date: Re: Is there an easy way to put a DIB on the clipboard?
- Next by Date: Does Setting RichTextBox.SeletcionStart Change RichTextBox.Text ?!?!?
- Previous by thread: Re: Time out errors
- Next by thread: Re: Time out errors
- Index(es):
Relevant Pages
|