User Controls Importing Problem (asp.net)(vb)
Posted
by Phil
on Stack Overflow
See other posts from Stack Overflow
or by Phil
Published on 2010-04-08T06:16:02Z
Indexed on
2010/04/08
6:23 UTC
Read the original article
Hit count: 230
I have this class that contains vars for db connection;
Public Shared s As String
Public Shared con As String = WebConfigurationManager.ConnectionStrings("foo").ToString()
Public Shared c As New SqlConnection(con)
Public Shared x As New SqlCommand(s, c)
I import this to my page like this;
Imports DBVars
I'm then able to access these vars from my page.
But if I try to import them into a user control the variables are not available. Am I making an error or is this expected?
Thanks.
© Stack Overflow or respective owner