Require help in migrating the VB6 code to VB,NET [modified]
-
Hi This is my Vb6 code --------------------------------------- Dim oOu As IADsOU Set oOu = np.OpenDSObject("LDAP://" & "OU=DC" & strLDAPEnd, vbNullString, vbNullString, ADS_SECURE_AUTHENTICATION) For Each child As ActiveDs.IADs In oOu Next child ---------------------------------------- This code is Working in VB6.But When i upgraded it to VB.net .I am geting an error saying that 'oOu' is not a collection type.. What is the wrong in this Thanks Chaitanya
modified on Friday, May 9, 2008 3:17 AM
-
Hi This is my Vb6 code --------------------------------------- Dim oOu As IADsOU Set oOu = np.OpenDSObject("LDAP://" & "OU=DC" & strLDAPEnd, vbNullString, vbNullString, ADS_SECURE_AUTHENTICATION) For Each child As ActiveDs.IADs In oOu Next child ---------------------------------------- This code is Working in VB6.But When i upgraded it to VB.net .I am geting an error saying that 'oOu' is not a collection type.. What is the wrong in this Thanks Chaitanya
modified on Friday, May 9, 2008 3:17 AM
I dont know what IADsOU is but I dont think it is a collection type. Foreach works on collection types. Try using a for loop to iterate through it instead.
At university studying Software Engineering - if i say this line to girls i find they won't talk to me Dan
-
I dont know what IADsOU is but I dont think it is a collection type. Foreach works on collection types. Try using a for loop to iterate through it instead.
At university studying Software Engineering - if i say this line to girls i find they won't talk to me Dan
IADsOU is a ActiveDS method .. In VB6 code it working good but inVB.NET ..not ..
-
IADsOU is a ActiveDS method .. In VB6 code it working good but inVB.NET ..not ..
foreach only works on .NET classes that impliment IEnumerable. If this is some sort of collection and I assume it is, it's not one that supports foreach. Just do a normal for loop instead.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )