Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Connection timeout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eric.goforth@gmail.com - 08 Jun 2006 21:09 GMT
Hello,

I have a connection string that looks like:

"SERVER=MyServer;DATABASE=MyDatabase;UID=Myuser;Connect Timeout=900;"

However, when I try to run the following, it times out after MUCH less
than 15 minutes:

   Private Sub RunUpdateTransaction(ByVal UpdateSQL As String, ByVal
UpdateConn As SqlConnection)

       Dim trnDeleteQuery As SqlTransaction =
UpdateConn.BeginTransaction(IsolationLevel.Serializable, "DeleteQuery")

       Dim cmdDeleteQuery As New SqlCommand(UpdateSQL, UpdateConn,
trnDeleteQuery)

       Try

           Dim iUpdated As Integer

           iUpdated = cmdDeleteQuery.ExecuteNonQuery

           'trnDeleteQuery.Rollback()

           trnDeleteQuery.Commit()

       Catch ex As Exception
           Throw ex
       Finally
           If Not cmdDeleteQuery Is Nothing Then
cmdDeleteQuery.Dispose()
           If Not trnDeleteQuery Is Nothing Then
trnDeleteQuery.Dispose()
       End Try

   End Sub

My delete query looks like:

DELETE FROM Table1 WHERE MyID IN (1,2,3,4,5);
DELETE FROM Table2 WHERE MyID IN (1,2,3,4,5)

However, there are about 32000 values in my where.

Running a SELECT query in SQL Server Query Analyzer with the same WHERE
clause took about 8 minutes.

Thanks,
Eric
eric.goforth@gmail.com - 08 Jun 2006 21:12 GMT
eric.gofo...@gmail.com wrote:
> Hello,
>
[quoted text clipped - 3 lines]
>
> However, when I try to run the following, it times out after MUCH less

Oops, reposted to m.p.d.f.adonet
sloan - 09 Jun 2006 03:53 GMT
thats the CONNECTION timeout.

aka, "try to CONNECT to the server for X amount of time"

you're connecting almost instantly.

you need the COMMANDTIMEOUT ... property.

its a part of the Connection object

> eric.gofo...@gmail.com wrote:
> > Hello,
[quoted text clipped - 6 lines]
>
> Oops, reposted to m.p.d.f.adonet

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.