>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?
>
>Thanks.
It's kind of hard to say from that description, but you could just retrieve a dataset with your info then use a foreach to iterate through the rows of the table(s) in it. (I can't test this code right now, but something like this should work):
DataTable table = ds["TableName"];
BusinessObjectEntity objectEntity = new BusinessObjectEntity();
foreach(DataRow row in table.Rows)
{
objectEntity.SetDataRow(row);
}
You could also use the Select() method of your DataTable object to filter it down a bit more if necessary (it returns an array of Rows, which you can also iterate through using a foreach).