Comparing data in a gridview

N

Nick Hodge \(MVP\)

Hi

I currently have a gridview connected to a SQLDatasource. (This data comes
from a remote iSeries). It shows catalogue sales as they build during the
day (works great). I have a local SQL server with the budget data for each
catalogue/day and wanted to compare the gridview data with this to display
KPI traffic lights as the sales build. (This is used across the organisation
and is connected 'live')

One issue is that all catalogue codes on the iSeries are like 00000153,
00000100,etc. If a catalogue is 'live' I can key on this as the data is the
same in both places. If the catalogue does not exist in the budget data
then it would be classed as 'dead' and should be grouped as such. (The total
of 'Dead' books should then show in the grid across all the books that made
it up, e.g If the 'Dead' budget for the day is £1,000 and the sum of the
'dead' books in the gridview were £1001, then all 'dead' book rows would
show a green light)

I am dabbling with the gridview RowDataBound event, passing the values to a
method to decide if it is 'live', 'dead', 'web', etc. but I have no idea how
to pick up and compare the other data, or, once the gridview is built, to
pass the 'dead' data across the catalogues that made it up.

I feel I am fighting the tool, so there must be a better way. (Explanation
not good, but if someone could just point me, that'd be great

Thanks a lot

--
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 
G

Greg9Strat

Hi Nick,

My recommendation is to load the data into a dataset first. Then do
some testing for your requirements and store that info into variables
(for instance, if the quota has been met for a category...). Or you
could manipulate the DataSet by adding columns and dynamically setting
the image in your new column...

Then you can bind your data from the dataset to the GridView control.

Hope this give an idea or helps...
Greg
 
N

Nick Hodge

Greg

Thanks for that... being a native VBA developer, this stateless world is
very strange, but I felt I was better building a dataset from the disparate
datasources and working with that.

I'll give it a go, thanks for the confidence boost

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk

Hi Nick,

My recommendation is to load the data into a dataset first. Then do
some testing for your requirements and store that info into variables
(for instance, if the quota has been met for a category...). Or you
could manipulate the DataSet by adding columns and dynamically setting
the image in your new column...

Then you can bind your data from the dataset to the GridView control.

Hope this give an idea or helps...
Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top