I have this class that contains vars for db connection;
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports System.Web.Configuration
Public Class DBVars
Public Shared s As String
Public Shared con As String = WebConfigurationManager.ConnectionStrings("NMMUDevConnectionStr").ToString()
Public Shared c As New SqlConnection(con)
Public Shared x As New SqlCommand(s, c)
Dim r As SqlDataReader
End Class
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 using the same method the variables are not available. Am I making an error or is this expected?
Thanks.