Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

something is wrong in vb.net 2005

Status
Not open for further replies.

MackAA

Programmer
Mar 21, 2006
13
CA
Hello everybody,

If anyone could tell me what's wrong in this folloeing code snippet, I'll appreciate.

'1. Create 4 classes (I've removed all internal code since it is useless for the test)



Public Class LockableDataObject

End Class



Public Class Business

Inherits LockableDataObject

End Class



Public Class LockableDataManager(Of CustomType As LockableDataObject)

End Class



Public Class BusinessManager

Inherits LockableDataManager(Of Business)

End Class



Module main

Public Sub main()

'This line works

Dim MyManager As LockableDataManager(Of Business) = New BusinessManager



'This line doesn't
(Is this a bug? or is this wanted?)

Dim MyManager2 As LockableDataManager(Of LockableDataObject) = New BusinessManager

End Sub

End Module

 
This is the error you must be getting. Follow the classes and what inherits which and what are the arguments.

Value of type 'Module1.BusinessManager' cannot be converted to 'Module1.LockableDataManager(Of ConsoleApplication1.Module1.LockableDataObject)'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top