Anthony wrote:
STARTING FROM THE BEGINNING.....
Basically trying to cast to EntityCollection from a generic type
Dim _EntityCollection As New EntityCollection(Of TblCustomersEntity)
Dim oCustomers as EntityCollection
oCustomers =ctype(_EntityCollection,EntityCollection) ***give error
***Error
Value of type 'SmallBiz.SBH.Dal.Adapter.llblgen.HelperClasses.EntityCollection(Of SmallBiz.SBH.Dal.Adapter.llblgen.EntityClasses.TblCustomersEntity)' cannot be converted to 'SmallBiz.SBH.Dal.Adapter.llblgen.HelperClasses.EntityCollection'.
Using adapter mode
Build 2.5 28August 2007
This error is caused because:
EntityCollection(Of TblCustomersEntity) isn't a subtype of EntityCollection(Of EntityBase2), which is the base type of EntityCollection. This is the same as: List(Of String) isn't a subtype of List(Of Object), although String is a subtype of Object. This means that you can't cast a List(Of String) to a List(Of Object) type.
So you should do:
Dim _EntityCollection As New EntityCollection()
or as Walaa said, cast to IEntityCollection2
You're using adapter, not selfservicing.