make a stored procedure to get all the count table data with cateory name ,and bind gridview with eval as cat,countdata
CREATE Procedure getallcountwithcat
as
begin
SELECT 'cat1' as cat, count(*) as countdata FROM table1 WHERE CATEGORY='cat1'
union all
select 'Cat2' as cat, count(*) as countdata FROM table2 WHERE CATEGORY='cat2'
union all
select 'Cat3' as cat ,count(*) as countdata FROM table3 WHERE CATEGORY='cat3'
union all
select 'cat4' as cat ,count(*) as countdata FROM table4 WHERE CATEGORY='cat4'
union all
select 'cat5' as cat ,count(*) as countdata FROM table5 WHERE CATEGORY='cat5'
end
if you want find last updated time tha u will have to add one filed updatetime and fill this field when any update u have done and select last one last updated time and pass this every table
i have change above stored procedure to get cat,countdata,updatetime
CREATE Procedure getallcountwithcat
as
begin
declare @catupdatetime1 nvarchar(50)=null
set @catupdatetime1=(select top(1)Update_At FROM table1 WHERE CATEGORY='cat1' order by Update_At desc)
declare @catupdatetime2 nvarchar(50)=null
set @catupdatetime2=(select top(1)Update_At FROM table2 WHERE CATEGORY='cat2' order by Update_At desc)
declare @catupdatetime3 nvarchar(50)=null
set @catupdatetime3=(select top(1)Update_At FROM table3 WHERE CATEGORY='cat3' order by Update_At desc)
declare @catupdatetime4 nvarchar(50)=null
set @catupdatetime4=(select top(1)Update_At FROM table4 WHERE CATEGORY='cat4' order by Update_At desc)
declare @catupdatetime5 nvarchar(50)=null
set @catupdatetime5=(select top(1)Update_At FROM table5 WHERE CATEGORY='cat5' order by Update_At desc)
SELECT 'cat1' as cat, count(*) as countdata,@catupdatetime1 as updatetime FROM table1 WHERE CATEGORY='cat1'
union all
select 'Cat2' as cat, count(*) as countdata ,@catupdatetime2 as updatetime FROM table2 WHERE CATEGORY='cat2'
union all
select 'Cat3' as cat ,count(*) as countdata ,@catupdatetime3 as updatetime FROM table3 WHERE CATEGORY='cat3'
union all
select 'cat4' as cat ,count(*) as countdata ,@catupdatetime4 as updatetime FROM table4 WHERE CATEGORY='cat4'
union all
select 'cat5' as cat ,count(*) as countdata ,@catupdatetime as updatetime FROM table5 WHERE CATEGORY='cat5'
end
now you can easly bind this data in gridview