Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Require help in migrating the VB6 code to VB,NET [modified]

Require help in migrating the VB6 code to VB,NET [modified]

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chaitanya kumar CVSS
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • C Chaitanya kumar CVSS

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • L Lost User

        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

        C Offline
        C Offline
        Chaitanya kumar CVSS
        wrote on last edited by
        #3

        IADsOU is a ActiveDS method .. In VB6 code it working good but inVB.NET ..not ..

        C 1 Reply Last reply
        0
        • C Chaitanya kumar CVSS

          IADsOU is a ActiveDS method .. In VB6 code it working good but inVB.NET ..not ..

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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 )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups