Recalculate DataSet Computed Column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have some troubles with a computed column in a DataSet
I have a typed DataSet ds, which is received from a WebService ws. The Table BestillingslisteLinie has one child-relation to the table BestillingslisteLinieKommentar
My computed column is added to the table BestillingslisteLinie like this
DataSet ds; //declared private to the clas
..
public dsBestilling HentBestillinger()
ds = ws.GetBestillingslister()
DataColumn col = new DataColumn("HarKommentar")
col.DataType = System.Type.GetType("System.Boolean")
col.Expression = "Count(Child.ID)"
ds.BestillingslisteLinie.Columns.Add(col)


This works fine - no problem. However, when I then later merge another DataSet with the same structure into ds, the computed column do not get recalculated.
I have some code which calls another WebService and then merges the returned DataSet into the existing DataSet ds like this
public dsBestiling Valider(int ID)
dsBestillingsliste dsMerge = ws.ValiderBestillingsliste(ID)
dsBestilling.Merge(dsMerge)

Do anyone know how to get the computed column to recalculate itself. By now the column always contains false on merged rows, although it should be true

Thanks
Mogens
 
Hi,

Why are you using Boolean datatype to get rows count? try to declare it as
Integer and it should be calculated properly.
 
Back
Top