R
Robin Thomas
I am fairly new to ASP.NET so I think I am missing something fundamental.
Anyway, quite often I am pulling data from a database, but then I need to
use that data to produce more data. A simple example would be: Let's say
Column1=StartDate and Column2=EndDate. In addition to displaying Column1 and
Column2, I need to do some calculations and display in as Column3.
The calculations are easy and can be done in the code-behind. How to display
it is another question.
However, they might not be math calculations. Take for example, a SQL query
that returns a list of servers and then for each server I use WMI to get
some additional information and then I need to display the servername (from
SQL) and the OS and Service Pack Version (from WMI) on a web page.
The way I have been handling it is creating a new table in memory and adding
the columns from the original SQL query and then doing the calculations and
adding that as a column. Then I'll use this new table to DataBind my
DataGrid or DataList.
Is this the best way to do it? I feel like this isn't the smartest way to
acomplish this.
Anyway, quite often I am pulling data from a database, but then I need to
use that data to produce more data. A simple example would be: Let's say
Column1=StartDate and Column2=EndDate. In addition to displaying Column1 and
Column2, I need to do some calculations and display in as Column3.
The calculations are easy and can be done in the code-behind. How to display
it is another question.
However, they might not be math calculations. Take for example, a SQL query
that returns a list of servers and then for each server I use WMI to get
some additional information and then I need to display the servername (from
SQL) and the OS and Service Pack Version (from WMI) on a web page.
The way I have been handling it is creating a new table in memory and adding
the columns from the original SQL query and then doing the calculations and
adding that as a column. Then I'll use this new table to DataBind my
DataGrid or DataList.
Is this the best way to do it? I feel like this isn't the smartest way to
acomplish this.