J
Jeff
I have a main project which references several DLLs. Each DLL will
access the same database as the main project. I'm storing the
connection string within the main project's "web.config" file, so in
theory the DLLs do not have "visibility" to the connection string.
I considered creating a public sub within each DLL (class) which allows
the connection string to be set (but not read):
Public Class myClass
'DATA CONNECTION
Private mobjDataConnection As New SqlClient.SqlConnection
Public Sub SetConnectionString(ByVal strValue As String)
mobjDataConnection.ConnectionString = strValue
End Sub
...
...
End Class
This way, only the main project's Web.Config file needs to contain the
connection string. The main project will simply pass the string to the
"SetConnectionString" method of the class.
Is this secure? If not, any suggestions?
access the same database as the main project. I'm storing the
connection string within the main project's "web.config" file, so in
theory the DLLs do not have "visibility" to the connection string.
I considered creating a public sub within each DLL (class) which allows
the connection string to be set (but not read):
Public Class myClass
'DATA CONNECTION
Private mobjDataConnection As New SqlClient.SqlConnection
Public Sub SetConnectionString(ByVal strValue As String)
mobjDataConnection.ConnectionString = strValue
End Sub
...
...
End Class
This way, only the main project's Web.Config file needs to contain the
connection string. The main project will simply pass the string to the
"SetConnectionString" method of the class.
Is this secure? If not, any suggestions?