Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating the Total Amount...
Message
De
09/07/2003 02:45:42
Larry Santos
Local Data System
Philippines
 
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00807166
Message ID:
00808331
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform