I have a main project (presentation layer) containing all of my forms and a data access layer which I am designing to return adapters to my BRL. If I define application settings in the main project, how do I retrieve them in the Data access layer which is referenced by the main presentation layer?
I have tried this:
but it complains and produces nothing
I have tried this:
but it complains and produces nothing
This:
complained the least but failed at Runtime, claiming there was no such variable.
This works in my main presentation layer (where the application settings are stored):
I could use my StateControl Class with a public shared string property and just store this from the presentation layer at application startup and use it wherever, but this seems woefully incorrect. Any ideas?
I have tried this:
Code:
Return "Data source=" & ConfigurationSettings.AppSettings("TRSDBServer") & "," _
& ConfigurationSettings.AppSettings("TRSDBPort") & ";Integrated security=SSPI;Initial Catalog=" _
& ConfigurationSettings.AppSettings("TRSDBName")
I have tried this:
Code:
Dim aConfig As Configuration.ConfigurationSettings
Dim strDBConnectTest As String = aConfig.AppSettings("TRSDBName")
This:
Code:
Return My.Settings.Item("TRSDBServer")
This works in my main presentation layer (where the application settings are stored):
Code:
objConnection = New SqlConnection("Data source=" & My.Settings.TRSDBServer & "," & My.Settings.TRSDBPort & ";Integrated security=SSPI;Initial Catalog=" & My.Settings.TRSDBName)
I could use my StateControl Class with a public shared string property and just store this from the presentation layer at application startup and use it wherever, but this seems woefully incorrect. Any ideas?