Table Mapping with Typed Dataset

  • Thread starter Thread starter Calvin
  • Start date Start date
C

Calvin

I've created a strongly typed DataSet, with a 2 related tables. a couple of
the columns in the parent are computed with expressions. One of which is a
Sum of a Child.column (Sum(Child.UnitCost).

Eitherway, since adding these expressions, I'm getting a
InvalidOperationException when I execute the Update method of corresponding
DataAdapter on the parent.

The column names haven't changed from the underlying data source, a table on
sql server. Admittedly, at this point in the execution, the child table has
not been filled yet, but that's fine, the expression columns can just stay
null at this point.

What am I doing wrong? Is it case that all expression columns are not meant
to be mapped back, but instead are just for use within the dataset?

:O(
 
Hi Calvin,

I would avoid expression columns when doing updates.
Instead, populate the calculated values yourself and do an acceptchanges on
each row if row was previously unchanged.
 
Back
Top