Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all articles
Browse latest Browse all 256

Getting correct values from class but cannot check breakpoint

$
0
0
Hi. I have this class that default to a connection string.
Code:

#Region "connectionstrings"
Public NotInheritable Class GlobalConnections
    Private Sub New()   
    End Sub
    Shared Sub New()     
        Try
            strconVrExternal = ConfigurationManager.ConnectionStrings("DBConnectionString").ToString()
        Catch ex As Exception
            ' This should be checked if we are not getting a db connection and we see that the connection is set and called correctly.
        End Try
    End Sub

    Public Shared Property strconVrExternal() As String
        Get
            Return m_strconVrExternal
        End Get
        Set(value As String)
            m_strconVrExternal = value
        End Set
    End Property
    Private Shared m_strconVrExternal As String
    Public Shared Sub Setstrcon(newString As String)
        strconVrExternal = newString
    End Sub
End Class

Everything works fine but i have a question as when i put a breakpoint in both sub new it never hits when i first call dim s as string = GlobalConnections. strconVrExternal from another class. I get the data fine but i cannot see it initialize. Only time a got a breakpoint hit was when i deleted all the debug symbols and only when i called ? GlobalConnections. strconVrExternal from immediate window.
Is there any chance that i won't get back data from this, thus hitting the catch ?
Thanks.

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>