Collecting the data into one object and sorting it in .NET/C# -


in our .net/c# project save users' browser name/version, os name, etc. in database. later on grab data , use statistics purposes. need somehow define, example:

5 customers had windows 7 + internet explorer 8
4 customers had windows xp + internet explorer 6 etc.

when getting data database, can define os , browser used, case when collect data, how browser , os used , quantity of such platforms? example search windows xp , system show me browsers used os , in quantity.

could give hint?

thanks.

sounds perfect fit group by operator (if you're using sql), or linq groupby() method (http://msdn.microsoft.com/en-us/library/system.linq.enumerable.groupby.aspx) if you're wanting stay within .net.

for example, in sql:

select count(*), os, browser yourtable group os, browser 

or, in linq:

var groups = yt in yourtable              group yt new { yt.os, yt.browser } ytgroup              select new { key = ytgroup.key, groups = ytgroup }; 

from here, you'll have set of groups, can obtain counts.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -