Converting BindingList(Of T) to Array

Posted by George on Stack Overflow See other posts from Stack Overflow or by George
Published on 2010-05-23T19:39:14Z Indexed on 2010/05/23 19:40 UTC
Read the original article Hit count: 210

Filed under:
Public Class Orders
 Inherits System.ComponentModel.BindingList(Of Order)
End Class


Public Sub DataBind(ByVal Orders() As Orders)
End Sub

Dim MyOrders() As Order = Orders.ToArray

SuperListBinder.DataBind(MyOrders) '<<Error occurs on this line

I don't understand this error. I think that I am passing the appropriate data type to a sub. I don't understand the meaning of "Cannot convert object of type x to an object of type x!

Note that, if relevant, my Solution File contains ,multiple projects and that they are all project references.

Error:
Error   1   Value of type '1-dimensional array of BESI.BusinessObjects.Order' cannot be converted to '1-dimensional array of BESI.BusinessObjects.Orders' because 'BESI.BusinessObjects.Order' is not derived from 'BESI.BusinessObjects.Orders'.   C:\My\Code\BESI\BesiAdmin\Forms\Activity.vb 17  34  BesiAdmin

© Stack Overflow or respective owner

Related posts about vb.net-2010