Skip to content Skip to sidebar Skip to footer

How To Display Group Data Separately Using Datalist In Asp.net?

I have a sql table which have the following data, Id City Country --- ------ ------------ 1 Delhi India 2 New York United States 3 Karachi Pakistan 4

Solution 1:

Your SQL should be

select country,city,count(city)
from dbo.location 
group by country,city order by country

Then use datarepeter to display your data. Follow this link

Solution 2:

You can use a DataSet, normalize your DB, read two tables into it and then display it with two nested DataRepeater, just like two for-loops would do.

Post a Comment for "How To Display Group Data Separately Using Datalist In Asp.net?"