开发者

Operation is not allowed when the object is closed

开发者 https://www.devze.com 2023-01-31 16:24 出处:网络
I am facing an error on the web page that I am working on. The problem is when I try to open up the web page: www.ice-tech.com It loads fine, but when you try to refresh it, it c开发者_StackOverflowra

I am facing an error on the web page that I am working on. The problem is when I try to open up the web page: www.ice-tech.com It loads fine, but when you try to refresh it, it c开发者_StackOverflowrashes.

You can see the error itself on-line. Can someone help me?


I see the following code failing:

Line 36:         If ConnectCount = 0 Then
Line 37:             ' Close the Connection
Line 38:             Conn.Close()
Line 39:             Conn = Nothing
Line 40:         End If

Looks like you are closing a connection that has already been closed. Check the Conncetion.State before closing it (again).

For more information see ConnectionState Enumeration.

Possible solution:

If ConnectCount = 0 And Conn.State == ConnectionState.Open Then
    ' Close the Connection
    Conn.Close()
    Conn = Nothing
End If
0

精彩评论

暂无评论...
验证码 换一张
取 消