ADO.NET offers the capability to add calculated columns in typed DataSets and use the Expression property of the those columns to specify the formulae for calculations. What I did not realize is that you must use the Fill method of the adapter instead of the Get method for calculated columns to properly populate. For example:

[sourcecode lang=”csharp”] using (MyTableAdapter adapter = new MyTableAdapter())
MyTypedDataSet.MyTable dt =
new MyTypedDataSet.MyTable(true);
adapter.FillData(dt, beginDate, endDate);

Post a Comment

Be the First to Comment!