ADO.NET Expression Column not calculating

  • Thread starter Thread starter Chris Butler via .NET 247
  • Start date Start date
C

Chris Butler via .NET 247

Hey all --

I have a DataSet with about 12,000-15,000 records (dependingon the user's choices and date ranges etc...) Most of the tablesare related to each other -- for example:

Accounts (Ie: Select)
Zones (Ie: Connecticut)
Monthly Data (Ie: January 2004) (MonthlyAverages)
Daily Data (Ie: January 1, 2004) (DailyAverages)
Hourly Data (Ie: January 1, 2004Hour 1) (Hourly Data)


The tables I am working with are Monthly, Daily, Hourly. The datais stored in SQL Server hourly. When I pull the data, theMonthly Data and Daily Data are calculated based off the hourlyaverages. So daily averages are based off the hourly data, andthe monthly averages are based off the daily averages. Prettysimple in a nutshell.... However, my issue is when the HourlyData is changed.... I use the .BeginLoadData on each of theDataTables to keep the hourly adjustments and calculationsperformance (takes 25 seconds without .BeginLoadData, and 0.12seconds with .BeginLoadData). When I change the hourly data, Ihave a method in my inherited DataSet which updates theExpressions to "recalculate" them, however, i noticed if theRowState of the parent differs from the child, the calculationsdo not take place.... Is there another way to do this withoutchanging the states of the parent rows? This does not make anysense to me......... Here's an example of the expression:

.Expression = "Avg(Child(" & ZONEDAILYTOHOURLY_RELATION & ")." &ForecastModelData.SCLR_FIELD & ")"

Thanks in advance.
 
Chris,

I have come across this problem earlier. How I fixed it earlier was "When I
specified the expression made the difference".

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik




Hey all --

I have a DataSet with about 12,000-15,000 records (depending on the
user's choices and date ranges etc...) Most of the tables are related to
each other -- for example:

Accounts (Ie: Select)
Zones (Ie: Connecticut)
Monthly Data (Ie: January 2004) (Monthly Averages)
Daily Data (Ie: January 1, 2004) (Daily Averages)
Hourly Data (Ie: January 1, 2004 Hour 1)
(Hourly Data)


The tables I am working with are Monthly, Daily, Hourly. The data is stored
in SQL Server hourly. When I pull the data, the Monthly Data and Daily Data
are calculated based off the hourly averages. So daily averages are based
off the hourly data, and the monthly averages are based off the daily
averages. Pretty simple in a nutshell.... However, my issue is when the
Hourly Data is changed.... I use the .BeginLoadData on each of the
DataTables to keep the hourly adjustments and calculations performance
(takes 25 seconds without .BeginLoadData, and 0.12 seconds with
..BeginLoadData). When I change the hourly data, I have a method in my
inherited DataSet which updates the Expressions to "recalculate" them,
however, i noticed if the RowState of the parent differs from the child, the
calculations do not take place.... Is there another way to do this without
changing the states of the parent rows? This does not make any sense to
me......... Here's an example of the expression:

..Expression = "Avg(Child(" & ZONEDAILYTOHOURLY_RELATION & ")." &
ForecastModelData.SCLR_FIELD & ")"

Thanks in advance.
 
Back
Top