Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating the Total Amount...
Message
From
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:
00808331
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform