Hi. I have this class that default to a connection string.
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.
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
Is there any chance that i won't get back data from this, thus hitting the catch ?
Thanks.