About Calculed Fields

  • Thread starter Thread starter Irakli Lomidze
  • Start date Start date
I

Irakli Lomidze

Dear Sirs.

I Have Question About Calculed Fields.
i have 5 Fields From Database Query And Want add 6-th Field6 that is
Calcued Based on that 5 fields. but it calculation reque call function
(method).
how i can do it ?
in MSDN
System.Type myDataType;
myDataType = System.Type.GetType("System.Decimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Total", myDataType, strExpr,
MappingType.Attribute);
myColumn.AutoIncrement = false;
myColumn.ReadOnly = true;
DataSet1.Tables["OrderDetails"].Columns.Add(myColumn);

But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Total", myDataType,
__CallCaluledFiledFunction(Price , Quantity) , MappingType.Attribute);
is it posible ?

Thank you in Advance
 
Hi Irakli,

One solution (though UI only) would be one that Jan suggested.
The other would be that you manually calculate value when necessary and
store it into field.
 
Back
Top