Hi Ben,
Do you have any sample code to bind Drop down list to the list of users
returned from a web service? Or do you have any other idea to do this?
I am struggling with binding this DD box to the AD users list?
My current code on Infopath OnLoad event is
Dim nodeusers As IXMLDOMNode =
thisXDocument.DOM.selectSingleNode("my:myFields/my:users")
Dim ds As DirectorySearcher = New DirectorySearcher
ds.SearchRoot = New DirectoryEntry("")
ds.Filter = GetFilterString()
ds.PropertyNamesOnly = True
ds.PropertiesToLoad.Add("name")
ds.SearchScope = SearchScope.OneLevel
'// (CacheResults) property by default is true
ds.CacheResults = True
ds.ReferralChasing = ReferralChasingOption.None
ds.Sort = New SortOption("name", SortDirection.Ascending)
'// start searching
Dim src As SearchResultCollection = ds.FindAll()
nodeusers.text = src.Count.ToString()
Dim sr As SearchResult
For Each sr In src
'Struggling at this point
nodeusers.text = sr.GetDirectoryEntry.ToString
Next
Private Function FormFilter(ByVal objectCategory As String, ByVal
filter As String)
Dim result As String
result = String.Format("(&(objectCategory={0})(name={1}))",
objectCategory, filter)
Return result
End Function
Private Function GetFilterString() As String
Dim filter As String = ""
filter += FormFilter("user", "*")
Return "(|" + filter + ")"
End Function
Thanks in advance.
Ashwani
> Hey Noel,
> There are the options that were noted earlier, accessing a file and placing
[quoted text clipped - 22 lines]
> >
> > Thanks in advance!
Noel - 15 Aug 2006 07:46 GMT
Thanks alot on your replies. I'll try it now.