VB 2010 - Create Custom Configuration Section Using ConfigurationSection

Hi,

I am trying to create custom section in app.connfig file of my Windows Form application following instructions on this page:

http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

but don't know how to do it.

I would like to have this in final:

<configuration>
   <startup>
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
   </startup>
   <productIdGroup>
      <ProductID="AAAAA-BBBBB"/>
   </productIdGroup>
</configuration>

Open in new window


Until now I have this code:

Imports System.Configuration

Namespace TestSection
    Class CustomConfigSection
        Inherits ConfigurationSection

        ' Create a "productId" element.
        <ConfigurationProperty("productId")> _
        Public Property ProductID() As String
            Get
                Return Me("productId")
            End Get
            Set(ByVal value As String)
                Me("productId") = value
            End Set
        End Property
    End Class
End Namespace

Open in new window


How can I store a value to key "ProductID" and save to app.config file?

I know, there are other possibilities how to store user settings, but I would like to store it in my custom section.

Thanks.
skdanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
0
skdanAuthor Commented:
Yes, but I would like to create section, which is not a part of Users Settings section.
0
Éric MoreauSenior .Net ConsultantCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skdanAuthor Commented:
I will study this tutorial. I think, this is exactly what I need. Thank you very much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.