Results 1 to 4 of 4

Thread: SQL error

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    32

    SQL error

    I keep receiving an SQL error. Not everytime but frequently. Does anyone
    know what to problem could be? This is the error i recieve:

    Timeout expired. The timeout period elapsed prior to obtaining a connection
    from the pool. This may have occurred because all pooled connections were in
    use and max pool size was reached.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Timeout expired. The
    timeout period elapsed prior to obtaining a connection from the pool. This
    may have occurred because all pooled connections were in use and max pool
    size was reached.


    and this is how u connect:
    conn = New SqlConnection("workstation id=" & Server & ";packet
    size=4096;integrated security=SSPI;data source=" & Server & ";persist
    security info=False;initial catalog=" & DB)
    conn.Open()

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: SQL error

    Heavey network traffic possibly. Try increasing the timeout on the SQL Server.

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2005
    Posts
    32

    Re: SQL error

    I think i narrowed down the problem.

    I wanted to build a system to report problems. So on every page i created this try-catch:

    try...
    ...
    ...
    Catch ex As Exception
    Response.Redirect("error.aspx", False)
    End Try

    in the try-block i frequently used Response.redirect("page.aspx), but then he always reported an error of threadstop or something. I looked around and i read the tip of using Response.Redirect("page.aspx", False). Maybe that has something to do with it, Maybe some sources don't get disposed or something like they used to do. It's the only big change i made before the error accured.

    Maybe some people know this, or know a better way to redirect in the middle of a method...

    hope somebody know a solution because i'm out af ideas...

    thxs in advance

  4. #4
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: SQL error

    Try this
    VB Code:
    1. Try
    2.    'Your code here
    3. Catch ex As Exception
    4.    Response.Redirect("Error.aspx")
    5. Catch th As System.Threading.ThreadAbortException
    6.    'Do Nothing, just catch the error
    7. End Try
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

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