Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scanning tables
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01184007
Message ID:
01184040
Views:
23
This message has been marked as the solution to the initial question of the thread.
Linda,

>I am still struggling to figure out the best way to cycle through a table when I need to look at just certain fields, use some values to look up other values and create an export text file. I'm feeling a bit dense. I haven't figured out how to just go to the next record using the entity object. The table doesn't really have a primary key and I wouldn't want to use it if it did, since I have to look at every record and wouldn't know the key without scanning t he table. I'm currently using a reader but it is more verbose and each field has to be converted to a type. I can make it work but it's a bit of a nuisance. Any suggestions for the best way to do this?

Paul's answer is absolutely correct (as usual <s>). In addition, if you are using MM .NET 2.3, you can use the new GetEntityList() or CreateEntityList() methods to return a list of strongly typed entities that you can cycle through. The MM .NET Dev Guide topic "Understanding Business Entity Objects" has a section "Creating Strongly Typed Lists of Entity Objects" that has this code sample:
// Create an Entity list from the business object's default DataTable
List<OrdersEntity> EntityList = this.CreateEntityList<OrdersEntity>();

foreach (OrdersEntity Order in EntityList)
{
   CustomerID = Order.CustomerID;
}
Best Regards,
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
Next
Reply
Map
View

Click here to load this message in the networking platform