BVNetwork.NotFound.Core.Data.DataAccessBaseEx.GetAllClientRequestCount C# (CSharp) Method

GetAllClientRequestCount() public method

public GetAllClientRequestCount ( ) : DataSet
return System.Data.DataSet
        public DataSet GetAllClientRequestCount()
        {
            string sqlCommand = string.Format("SELECT [OldUrl], COUNT(*) as Requests FROM {0} GROUP BY [OldUrl] order by Requests desc", REDIRECTSTABLE);
            return ExecuteSQL(sqlCommand, null);
        }

Usage Example

Esempio n. 1
0
        public static Dictionary <string, int> GetRedirects()
        {
            var keyCounts         = new Dictionary <string, int>();
            var keyList           = new List <string>();
            DataAccessBaseEx dabe = DataAccessBaseEx.GetWorker();
            var allkeys           = dabe.GetAllClientRequestCount();

            string oldUrl;

            foreach (DataTable table in allkeys.Tables)
            {
                foreach (DataRow row in table.Rows)
                {
                    oldUrl = row[0].ToString();


                    keyCounts.Add(oldUrl, Convert.ToInt32(row[1]));
                }
            }

            return(keyCounts);
        }