Populating combobox with entitycollection

Posts   
 
    
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 29-Sep-2007 02:19:14   

When i pass an entitycollection to a form as a parameter..i can populate a combo box! Do i need to type cast the passed entity collection?

_Private Sub Button_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.DoubleClick Dim oCustomers As New EntityCollection(New TblCustomerEntityFactory)

        Dim oCustomersXML As String = wsthisSolution.GetCustomersXML(1)

oCustomers.ReadXml(oCustomersXML )

        Dim FormMain As New thisSolution( oCustomers)

End Sub

Public Sub New(ByVal Customers As EntityCollection)
    ' This call is required by the Windows Form Designer.
    InitializeComponent()

    Me.cmboCustomers.DisplayMember = "Name"
    Me.cmboCustomers.ValueMember = "CustomerId"
    Me.cmboCustomers.DataSource = oCustomers

End Sub_