Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating the Total Amount...
Message
 
To
09/07/2003 02:45:42
Larry Santos
Local Data System
Philippines
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00807166
Message ID:
00808502
Views:
20
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.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform