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(

Re: Table Mapping with Typed Dataset by Miha

Miha
Fri Apr 29 01:34:59 CDT 2005

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.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Calvin" <calvin@discussions.microsoft.com> wrote in message
news:BE975998.13C4%calvin@discussions.microsoft.com...
> 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(
>



Re: Table Mapping with Typed Dataset by Calvin

Calvin
Fri Apr 29 08:22:59 CDT 2005

I think you're right. I'll keep it simple.

Thanks for your reply.


On 29/4/05 7:34 am, in article O7PIRWITFHA.1040@TK2MSFTNGP10.phx.gbl, "Miha
Markic [MVP C#]" <miha at rthand com> wrote:

> 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.