D
Derek Hart
Trying to read web.config inside a property of a usercontrol. Cannot seem to
do it. Should this be allowed? Do I need to read from a text file, or can I
use web.config? This is a winforms app, but web is mixed in a little, so I
will have a web.config file.
Imports System.Web.Configuration.WebConfigurationManager
<CategoryAttribute("Design"), _
DefaultValueAttribute(GetType(String), ""), _
DescriptionAttribute("Name of the data field."), _
Editor(GetType(MergeFieldNameBuilder),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property DataField() As String
Get
Return
System.Web.Configuration.WebConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString
End Get
Set(ByVal value As String)
_DataField = value
End Set
End Property
do it. Should this be allowed? Do I need to read from a text file, or can I
use web.config? This is a winforms app, but web is mixed in a little, so I
will have a web.config file.
Imports System.Web.Configuration.WebConfigurationManager
<CategoryAttribute("Design"), _
DefaultValueAttribute(GetType(String), ""), _
DescriptionAttribute("Name of the data field."), _
Editor(GetType(MergeFieldNameBuilder),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property DataField() As String
Get
Return
System.Web.Configuration.WebConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString
End Get
Set(ByVal value As String)
_DataField = value
End Set
End Property