Results 1 to 3 of 3

Thread: Bug with VS.Net 2003 SQL Server Debugging feature?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Malaysia
    Posts
    64

    Bug with VS.Net 2003 SQL Server Debugging feature?

    My app keep on throwing a :

    System.InvalidOperationException

    with the message:
    Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.

    since upgrading to VS.Net 2003.

    It seems that with SQL Server Debugging turned on in :

    Project -> Properties -> Configuration Properties -> Debugging -> SQL Server Debugging

    The connection to the SQL Server isn't closed even when I have a cn.close in my code.

    When I turn off the SQL Server Debugging the connection closes properly. This is my code to recreate the error.

    Dim i As Integer
    For i = 1 To 1000
    Dim cn As New SqlConnection
    cn.ConnectionString = "Initial Catalog=MyDB;Data Source=MyPC;User ID=sa;password=;Connection Timeout=5"

    cn.Open()
    cn.Close()
    Console.WriteLine(i & " connections opened")
    Next
    End Sub

    With SQL Server Debugging turned on the exception is thrown every time after opening 100 connections. The exact same code runs fine when it's turned off.

    Has anyone encountered this problem and is there a fix available? I really need the SQL Debugging feature in some of my projects.

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Dude, why are you opening 1000 connections?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Malaysia
    Posts
    64
    The code here is just to test the theory. Plus I'm not opening 1000 connections.
    I'm opening and closing the connections. Should have no error, but with the SQL Server Debugging on, the exception is thrown at the 100th iteration.

    In my actual app the connections are opened and closed when i load a form to get user's personal preferences, that kind of stuff. So it's opened quite a lot anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width