G
Guest
Hi Code guru's
I have created a user control which has access, and thus makes use of a shared singleton class like:
Dim MyAppSettings As DLAppSettings = DLAppSettings.GetAppSettings
This singleton class has amongst other stuff the following line of code in it:
Private m_DL_DBPath As String = System.Configuration.ConfigurationSettings.AppSettings("DMDatabasePath")
As you guess, it must read a string containing the path. Based on this string, a connection string is build later in the code.
Now the control is placed onto a form, and when I open the form (in design time) in the editor, it seems code is executed. And the code fails because the m_DL_DBPath variable has the value nothing.
Yet everything works as it is supposed to be when compiling and running the code.
1) Why is code executing in the designer when I throw user controls on a form?
2) Does System.Configuration.ConfigurationSettings.AppSettings work in design time?
Help is much appreciated as I am already hammering for three days on this.
eMKa
I have created a user control which has access, and thus makes use of a shared singleton class like:
Dim MyAppSettings As DLAppSettings = DLAppSettings.GetAppSettings
This singleton class has amongst other stuff the following line of code in it:
Private m_DL_DBPath As String = System.Configuration.ConfigurationSettings.AppSettings("DMDatabasePath")
As you guess, it must read a string containing the path. Based on this string, a connection string is build later in the code.
Now the control is placed onto a form, and when I open the form (in design time) in the editor, it seems code is executed. And the code fails because the m_DL_DBPath variable has the value nothing.
Yet everything works as it is supposed to be when compiling and running the code.
1) Why is code executing in the designer when I throw user controls on a form?
2) Does System.Configuration.ConfigurationSettings.AppSettings work in design time?
Help is much appreciated as I am already hammering for three days on this.
eMKa