I have a table with a single column, auto-incremented primary key. I have a grid that is bound to an ES collection based on this table. The collection is loaded up on a web service, serialized, deserialized on the client and bound to the grid.
My problem is in regards to serializing the collection after deleting a row. On calling the serialization method, I get the error "System.InvalidOperationException: There was an error generating the XML document. ---> System.ArgumentException: Column 'LopGlfinanestimatesKey' does not belong to table". I'd seen this in regards to not including a certain field in the select part of the Query, but that doesn't apply as I most definitely have that field in my collection and on the grid. I followed it through and saw that the error originated from a call to the "GetOriginalColumnValue" method (only done if the Entity had been marked as deleted):
Code:
if (this.Entity.es.IsDeleted)
return (System.Int32?)this.Entity.
GetOriginalColumnValue(LopGlfinanestimatesTblMetadata.PropertyNames.LopGlfinanestimatesKey);
else
return this.Entity.LopGlfinanestimatesKey;
I've seen mention that the GetOriginalColumnValue method just queries the DataRow associated with it with a version specifier and the column name passed into it. If that is the case, wouldn't I want to use the ColumnNames collection in this call as the DataRow uses them instead of PropertyNames?
Anyway, this is my attempt to figure out why this isn't working. I'm sure I'm just missing something obvious. So, why can't that GetOriginalColumnValue method find my PrimaryKey column? Thanks in advance, Adam.