Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Practices looping through bizEntities in bizObject
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01163000
Message ID:
01163554
Views:
10
Jason,

>Dim fieldsObj As cFormFields
>Dim fieldEnt As cFormFieldsEntity
>
>For Each dr As DataRow In fieldsObj.DataSet.Tables(0).Rows
> fieldEnt = New cFormFieldsEntity
> With fieldEnt
> .SetDataRow(dr)
> Debug.Print(.Visible)
> End With
>Next
>
>Is there a syntax in MM.Net that resembles the first approach (#1 above)?

For now, the way you have shown is the best way to do this. The upcoming version of MM .NET (2.3) will make this a little easier for you by way of Generic lists. There is a new CreateEntityList() method on mmBusinessObject which creates a generic list of entity objects that have been hydrated with the DataRows from a DataTable. This new method returns a generic list of objects that you can then iterate through like this:
List<OrdersEntity> EntityList = this.CreateEntityList<OrdersEntity>();

foreach (OrdersEntity Order in EntityList)
{
	CustomerID = Order.CustomerID;
}
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform