locked
'Microsoft.VisualBasic.Collection' has no type parameters and so cannot have type arguments. RRS feed

  • Question

  • Hi,

    i am using sample code provided by Microsoft, i am getting error while using this code:

     Dim collConnections As Collection(Of ValidatedPatientConnection)

    The error is:'Microsoft.VisualBasic.Collection' has no type parameters and so cannot have type arguments.

    Can anyone tell how to remove this error.
    Tuesday, July 19, 2011 1:55 PM

Answers

  • Collection is in System.Collections.ObjectModel, not System.Collections.Generic (where most collections live), so you might have to add an import for it.

    • Marked as answer by testing_mhv Tuesday, July 19, 2011 4:11 PM
    Tuesday, July 19, 2011 3:56 PM

All replies

  • VB is really not my area of expertise, but I think you need:

    Dim collConnections As New Collection(Of ValidatedPatientConnection)

    Tuesday, July 19, 2011 3:41 PM
  •  Visual studio highlights for the keywords,definitions but it was not highlighting "Collection" i included Microsoft.VisualBasic.Collection still it was not being highlighted.

    I don't know what went wrong.


    Tuesday, July 19, 2011 3:50 PM
  • Collection is in System.Collections.ObjectModel, not System.Collections.Generic (where most collections live), so you might have to add an import for it.

    • Marked as answer by testing_mhv Tuesday, July 19, 2011 4:11 PM
    Tuesday, July 19, 2011 3:56 PM
  • Ah ,yes it works fine now.....thanks a lot.
    Tuesday, July 19, 2011 4:11 PM