My.Settings value problem in VB2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to store the value of an LDAP Filter string in the app.config
file of a VB2005 application.

I've made the following entry:
<setting name="LDAPFilterSring"
serializeas="String">
<value>"(&(objectcategory=person)(objectclass=user))"</value>
</setting>

The ">"(&(objectcategory" string is underlined and it reports "Expecting
';'." when I hover over it.

Can anyone tell me what is wrong?

Thanks
 
Hi,

I think you may try the steps below with IDE.
1. Open Project Properties page
2. Click Setting Tab
3. Add a setting named LDAPFilterSring, select Scope Application, Value
(&(objectcategory=person)(objectclass=user)).
4. observe the app.config.
<WindowsApplication1.My.MySettings>
<setting name="LDAPFilterSring" serializeAs="String">

<value>(&amp;(objectcategory=person)(objectclass=user))</value>
</setting>
</WindowsApplication1.My.MySettings>
5. Use code to show the property which will be correct.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox(My.Settings.LDAPFilterSring)
End Sub

(&(objectcategory=person)(objectclass=user))


Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

I am posting to check if you have any concern on this issue.
If so, please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

thanks for your reply. For some reason, I only got a notification for your
second posting not the first.

I think my problem occured because I tried to edit the app.config file
directly and not using the settings tab.

I've redone things your way and it works fine.

thanks again
 
Back
Top