adding columns to data table

  • Thread starter Thread starter Jimbo
  • Start date Start date
J

Jimbo

Hi, I'm working on some basic analysis stuff and want to (ultimately)
display my data on a chart by a month breakdown.

To get each months data I need to run a separate query on the db, but I
want to display all the data in a table form, basically with columns
representing the month period.

So Is it possible for me to create a table object and then just add each
column and then plumb it with the necesary data or is there a better way of
doing this?

Also, can I just point some chart object at a table object and pretty much
them get on with doing their stuff or would some oher collection be better
suited to use with a chart objects (I don't even know if there are any
chart objects yet!!!)

I'm winging it a bit here guys....
 
Jimbo - there are 2 possbile solutions (for which I can think of right now)
for the problem with the column.

First - add the column after populating the datatable and set it up as a
calculated field on some other column. This one should be a little slower
that your second option.

Second one - extract the month's value inside a SQL statement (stored proc
will be the fastest and most secure thing to use) and then populate the
datatable with a call to the proc. That's the better one, I think.

About the charts - use SQL Server Reporting Services (if you're using SQL
Server 2000 for a data store). Will work great with the stored proc thing.

Cheers,
Branimir
 
Back
Top