<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Owner and Co-Founder of Web Ascender, a web design and development company. ASP.NET Developer, Michigan State Alumni and Sports Enthusiast.</description><title>Kevin Southworth</title><generator>Tumblr (3.0; @ksouthworth)</generator><link>http://www.kevinsouthworth.com/</link><item><title>The DotNetNuke ListController is Slooooow</title><description>&lt;p&gt;In one of our custom DNN modules we are grabbing the list of Countries and Regions for each Country for the DotNetNuke Host List.  This is normally a good thing since we then have a standardized list of Countries/Regions, and it also allows the DNN Site Administrator to add new Countries and/or Regions to the list and have them show up automatically in our module.&lt;/p&gt;
&lt;p&gt;The problem is that the DNN ListController API seems to be very slow when dealing with larger sets of Countries and Regions.  A customer of ours had customized their list to include many more countries, and many more regions for each country.  All of a sudden our module slowed to a crawl!&lt;/p&gt;
&lt;p&gt;I ran the RedGate ANTS profiler on the code and found the “GetListEntryInfoCollection()” method on the “ListController” DNN class was taking almost 4 seconds to execute!!&lt;/p&gt;
&lt;p&gt;I ended up writing my own helper method to retrieve the same list in under 0.5 seconds.  This may not be a best practice, since my function is calling straight SQL through ADO.Net, but it’s definitely faster to execute!&lt;/p&gt;
&lt;p&gt;The relevant code snippets are below.&lt;/p&gt;
&lt;p&gt;——————————————————————-&lt;/p&gt;
&lt;pre&gt;        internal static List GetCountryListAdoNet()
        {
            string sql = string.Format(@"
                SELECT
                country.Value as CountryCode
                ,country.[Text] as CountryName
                ,region.Value as RegionCode
                ,region.[Text] as RegionName
                FROM {0}Lists country
                LEFT JOIN {0}Lists region ON country.EntryID = region.ParentID
                WHERE country.ListName = 'Country'
                --ORDER BY country.[Text], region.[Text]
            ", GetDbObjectQualifier() ?? "");

            Dictionary countries = new Dictionary();

            using (IDataReader reader = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(sql))
            {
                while (reader.Read())
                {
                    string countryCode = reader.GetString(0);
                    string countryName = reader.GetString(1);

                    CountryInfo country;
                    if(!countries.TryGetValue(countryCode, out country))   
                    {
                        country = new CountryInfo() { CountryCode = countryCode, Name = countryName };
                        countries[countryCode] = country;
                    }

                    if (!reader.IsDBNull(2) &amp;&amp; !reader.IsDBNull(3))
                    {
                        country.Regions.Add(reader.GetString(3), new RegionInfo() { RegionCode = reader.GetString(2), Name = reader.GetString(3) });
                        //country.Regions.Add(new RegionInfo() { RegionCode = reader.GetString(2), Name = reader.GetString(3) });
                    }
                }
            }

            var list = countries.Values.ToList();
            list.Sort((left, right) =&gt; left.Name.CompareTo(right.Name));

            return list;
        }

    internal class CountryInfo
    {
        public string CountryCode { get; set; }
        public string Name { get; set; }
        public SortedList Regions { get; set; }

        public CountryInfo()
        {
            Regions = new SortedList();
        }
    }

    internal class RegionInfo
    {
        public string RegionCode { get; set; }
        public string Name { get; set; }
    }


&lt;/pre&gt;</description><link>http://www.kevinsouthworth.com/post/577994536</link><guid>http://www.kevinsouthworth.com/post/577994536</guid><pubDate>Fri, 07 May 2010 01:15:55 -0400</pubDate></item><item><title>Installing DNN 5.3.1</title><description>&lt;p&gt;Let’s see how this goes, excited to try the new taxonomy and user profile features&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/472547719</link><guid>http://www.kevinsouthworth.com/post/472547719</guid><pubDate>Thu, 25 Mar 2010 10:06:28 -0400</pubDate></item><item><title>Why DNN object qualifiers are a pain in the butt!</title><description>&lt;a href="http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/333.aspx"&gt;Why DNN object qualifiers are a pain in the butt!&lt;/a&gt;</description><link>http://www.kevinsouthworth.com/post/470584802</link><guid>http://www.kevinsouthworth.com/post/470584802</guid><pubDate>Wed, 24 Mar 2010 13:53:42 -0400</pubDate></item><item><title>Web Ascender launches Product Division: www.DNNspot.com</title><description>&lt;p&gt;After a lot of hard work, we (Web Ascender) have launched a brand new Product Division: &lt;a href="http://www.DNNspot.com"&gt;www.DNNspot.com&lt;/a&gt; !  DNNspot provides pre-packaged modules for the popular DotNetNuke content management system.  Some of our current modules that are available now:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Online Store and Shopping Cart&lt;/li&gt;
&lt;li&gt;Content Rotator to display photo and content slide shows&lt;/li&gt;
&lt;li&gt;Live Support / Live Agent Chat&lt;/li&gt;
&lt;li&gt;Referral Tracker (see where your visitors came from)&lt;/li&gt;
&lt;li&gt;Sitemap&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;We plan to add more modules in the future, but for now, congratulations to &lt;a href="http://www.webascender.com"&gt;the team &lt;/a&gt;for all their hard work!&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/451400624</link><guid>http://www.kevinsouthworth.com/post/451400624</guid><pubDate>Mon, 15 Mar 2010 23:22:49 -0400</pubDate></item><item><title>geek if you’re looking for a good .NET component to read excel files, check out gembox...</title><description>&lt;p&gt;&lt;h1&gt;geek if you’re looking for a good .NET component to read excel files, check out gembox software&lt;/h1&gt;&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/371651771</link><guid>http://www.kevinsouthworth.com/post/371651771</guid><pubDate>Thu, 04 Feb 2010 22:31:44 -0500</pubDate></item><item><title>Web Ascender announces product division</title><description>&lt;a href="http://www.capitalgainsmedia.com/innovationnews/webascender0402.aspx"&gt;Web Ascender announces product division&lt;/a&gt;</description><link>http://www.kevinsouthworth.com/post/344439107</link><guid>http://www.kevinsouthworth.com/post/344439107</guid><pubDate>Wed, 20 Jan 2010 10:49:48 -0500</pubDate></item><item><title>Just installed Chrome Beta and a delicious extension, feels great to finally have extensions in...</title><description>&lt;p&gt;Just installed Chrome Beta and a delicious extension, feels great to finally have extensions in chrome&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/332463628</link><guid>http://www.kevinsouthworth.com/post/332463628</guid><pubDate>Wed, 13 Jan 2010 10:07:39 -0500</pubDate></item><item><title>I’m attending CodeMash 2010</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kvw8pzZixP1qaqjnzo1_250.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I’m attending CodeMash 2010&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/322006531</link><guid>http://www.kevinsouthworth.com/post/322006531</guid><pubDate>Thu, 07 Jan 2010 15:25:11 -0500</pubDate></item><item><title>New Year's Resolutions</title><description>&lt;p&gt;&lt;ol&gt;&lt;li&gt;Eat healthier (breakfast every day, cut fast food to twice/wk max, bring lunches, plan dinners each week)&lt;/li&gt;
&lt;li&gt;Work out at least 4 days/wk&lt;/li&gt;
&lt;li&gt;Learn a new computer language (Ruby on Rails)&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/313206482</link><guid>http://www.kevinsouthworth.com/post/313206482</guid><pubDate>Sat, 02 Jan 2010 13:33:48 -0500</pubDate></item><item><title>Nifty tool for checking/validation your website for SEO and Performance optimizations</title><description>&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/12/15/search-engine-optimization-seo-toolkit.aspx"&gt;Nifty tool for checking/validation your website for SEO and Performance optimizations&lt;/a&gt;</description><link>http://www.kevinsouthworth.com/post/286428591</link><guid>http://www.kevinsouthworth.com/post/286428591</guid><pubDate>Wed, 16 Dec 2009 14:58:36 -0500</pubDate></item><item><title>Michigan will be smoke fee on May 1st !</title><description>&lt;a href="http://www.mlive.com/politics/index.ssf/2009/12/granholm_gets_smoking_ban_will.html"&gt;Michigan will be smoke fee on May 1st !&lt;/a&gt;</description><link>http://www.kevinsouthworth.com/post/279033055</link><guid>http://www.kevinsouthworth.com/post/279033055</guid><pubDate>Fri, 11 Dec 2009 10:33:17 -0500</pubDate></item><item><title>Pretty sweet Visual Studio Add-In for customized build numbers</title><description>&lt;a href="http://autobuildversion.codeplex.com"&gt;Pretty sweet Visual Studio Add-In for customized build numbers&lt;/a&gt;</description><link>http://www.kevinsouthworth.com/post/277122933</link><guid>http://www.kevinsouthworth.com/post/277122933</guid><pubDate>Thu, 10 Dec 2009 00:00:36 -0500</pubDate></item><item><title>Tasty dinner at Tomato Bros in Howell :)</title><description>&lt;p&gt;Tasty dinner at Tomato Bros in Howell :)&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/272424616</link><guid>http://www.kevinsouthworth.com/post/272424616</guid><pubDate>Sun, 06 Dec 2009 19:56:10 -0500</pubDate></item><item><title>At the MSU game</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_ku5lq6BnUN1qaqjnzo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;At the MSU game&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/269626574</link><guid>http://www.kevinsouthworth.com/post/269626574</guid><pubDate>Fri, 04 Dec 2009 19:36:41 -0500</pubDate></item><item><title>Excited for the MSU game tonight with Angie, should be a W</title><description>&lt;p&gt;Excited for the MSU game tonight with Angie, should be a W&lt;/p&gt;</description><link>http://www.kevinsouthworth.com/post/268968238</link><guid>http://www.kevinsouthworth.com/post/268968238</guid><pubDate>Fri, 04 Dec 2009 07:14:32 -0500</pubDate></item></channel></rss>
