当前位置: 代码迷 >> VB Dotnet >> asp.net 数据库状态The connection's current state is connecting.该如何解决
  详细解决方案

asp.net 数据库状态The connection's current state is connecting.该如何解决

热度:1986   发布时间:2013-02-26 00:00:00.0
asp.net 数据库状态The connection's current state is connecting.

我登录网站时经常报这种错。其中调用的Connection函数是这样的:
 Public Shared ReadOnly Property Connection() As SqlConnection
        Get
            Dim connectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
            If m_connection Is Nothing Then
                m_connection = New SqlConnection(connectionString)
                m_connection.Open()
                'ElseIf m_connection.State = System.Data.ConnectionState.Open Then
                '    m_connection.Close()
                '    m_connection.Open()
            ElseIf m_connection.State = System.Data.ConnectionState.Closed Then
                m_connection.Open()
            ElseIf m_connection.State = System.Data.ConnectionState.Broken Then
                m_connection.Close()
                'm_connection.Dispose()
                m_connection.Open()
            End If
            Return m_connection
        End Get
    End Property 

这个错误虽然经常出现,但一刷新就好了。请问怎么解决??谁知道??分数不高,拜托了。

------解决方案--------------------------------------------------------
楼主怎么解决的
  相关解决方案