ADO.NET Calculated Columns

September 9th, 2006

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:

using (MyTableAdapter adapter = new MyTableAdapter())
{
    MyTypedDataSet.MyTable dt =
          new MyTypedDataSet.MyTable(true);
    adapter.FillData(dt, beginDate, endDate);
}
Comments are closed.