ADO.NET Calculated Columns

September 9th, 2006 Leave a comment Go to comments

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);
}

  1. No comments yet.
  1. No trackbacks yet.
 

Comment moderation is enabled. Your comment may take some time to appear.