Larry,
I'm not understanding what you are asking. You can't update a calculated field to the backend. There is no field to map to. You would manually need to calculate the total for the field then set the field equal to the calculation, then update the field.
>Hi,
>
>thanks for the reply. I already have a structure for the total of in OrderMain of OrderTotal. how to to update my field in Ordertotal to this
>ds.Tables["Orders"].Columns.Add("OrderTotal", typeof(Decimal),
> "Sum(Child(OrdersOrderDetails).ItemTotal)")?
>
>TIA
>
>>Hi Larry,
>>
>>You can use a DataRelation and an expression-based column to simulate a join.
>>
>>
>>DataSet ds = new DataSet();
>>
>>...
>>
>>ds.Relations.Add("OrdersOrderDetails",
>> ds.Tables["Orders"].Columns["OrderID"],
>> ds.Tables["Order Details"].Columns["OrderID"]);
>>
>>ds.Tables["Order Details"].Columns.Add("ItemTotal", typeof(Decimal),
>> "Quantity * UnitPrice");
>>ds.Tables["Orders"].Columns.Add("NumItems", typeof(int),
>> "Count(Child(OrdersOrderDetails).ProductID)");
>>ds.Tables["Orders"].Columns.Add("OrderTotal", typeof(Decimal),
>> "Sum(Child(OrdersOrderDetails).ItemTotal)");
>>
>>
>>>Hi,
>>>
>>>I have a module ORDER and has ORDER DETAIL..
>>>
>>>I want to calculate the total amount in order detail and put it to the ORDER using a grid
>>>
>>>
>>>TIA
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi