Ciprian
Aug 29th, 2002, 01:22 AM
Hello,
I have a problem while reading Dynamic properties in a User Control.
Is it possible that at design-time when I put the control on a form to get data from app.config file or it's possible only at run-time? I want to simulate the WriteProperty and ReadProperty from VB6. With forms works, but for User Controls doesn't.
The next code gives an error: "The key... does not exist in configuration file"
Dim cfgReader As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader()
Me.NValue = CType(cfgReader.GetValue("JN.NValue", GetType(System.String)), String)
And this one does nothing and JValue is empty.
Dim config As Configuration.ConfigurationSettings
Me.JValue = config.AppSettings("JN.JValue")
Thank You,
Ciprian
I have a problem while reading Dynamic properties in a User Control.
Is it possible that at design-time when I put the control on a form to get data from app.config file or it's possible only at run-time? I want to simulate the WriteProperty and ReadProperty from VB6. With forms works, but for User Controls doesn't.
The next code gives an error: "The key... does not exist in configuration file"
Dim cfgReader As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader()
Me.NValue = CType(cfgReader.GetValue("JN.NValue", GetType(System.String)), String)
And this one does nothing and JValue is empty.
Dim config As Configuration.ConfigurationSettings
Me.JValue = config.AppSettings("JN.JValue")
Thank You,
Ciprian