Hi this is a follow on from another query I had... I want to loop through a row creating entities from this row and then adding the entity to the collection object..
When I loop through the row the first column throws an exception saying the column name does not exist.. I found the reason, the column name is called OutboundMessageID (note the ID case) BUT the entity get/set member is OutboundMessageId, (ie small d)..
I think is the cause of the exception from the loop below..
I have generated the code with the MakeElementNamePascalCasing in case this was causing the problem however this problem occurs with this set to either true or false..
If anyone can help then I would appreciate it, obviously I can set each member of the entity seperately however this entity may change and I dont want to keep updating this piece of code hence the loop.
Many thanks
Richard
OutboundMessagesEntity entity = (OutboundMessagesEntity)collection.AddNew();
foreach(DataColumn column in table.Columns) {
entity.SetNewFieldValue(column.ColumnName, row[column]);
}