select count(*) from MyTable
Using SQL to count all records in a table with unique/distinct values in a particular attribute:
select count(distinct MyId) from MyTable
This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.
select count(*) from MyTable
select count(distinct MyId) from MyTable
TechEd 2011 made me reminisce about my old frienemy the .NET Compact Framework. I will eulogize: Friends and fellow developers, we are here today to pay tribute to our friend of almost 10 years. We were coached, pushed, begged, and commanded to embrace you as you made life so much better for us. Yes, we had to be convinced of that, and we hated you at first. You could not go out without a healthy dose of p/invokes, work-arounds, and patches, but we managed to somehow embrace you as your capabilities grew. Now, you are gone. Plucked from us without notice.
I feel almost as sorry for CF as I did for myself after Microsoft threw its mobile developers under the bus last year when we were told there was no upgrade path from Windows Mobile to Windows Phone 7 (WP7). After stewing on this new direction last year, I have finally come to the conclusion that the abandonment of Window Mobile was actually a good thing. No, I have not embraced WP7. I had never seen another Windows Phone in the wild until I when to TechEd 2011 in Atlanta (and I have had my Samsung Focus since November 2010). Needless to say, the popularity of WP7 is so low it would be risky to venture off in that direction at this time. I am sure others feel the same way. One session at the conference said the ComScores for March 2011 placed Windows Mobile 6 together with WP7 at a 7.5% share of the smartphones in the US (and that is a total of 72.5 million smartphone users). Just for comparison, Android was 34.7%, RIM was 27.1%, and Apple was 25.5%. Since probably half of Microsoft’s 7.5% share is Windows Mobile, that leaves a paltry base of users to target (close to the Palm share of 2.8%). How many palm apps are people writing today? Now, you may ask why I think Microsoft’s throwing its mobile developers under the bus is a good thing. Well, it forced me to go develop for Android, BlackBerry, and iOS. I have traded my less than 7.5% Microsoft base for a 87.3% base. I may one day consider WP7 for my applications, but not today. The moral of the story for Microsoft is that if you tell your developers that they are going to have to rewrite their applications from scratch to run on the new version of the platform, they might spend those resources rewriting their apps for another platform (like Android). This business pattern is unfortunately pretty common (look at Intergraph’s upgrade from FRAMME to G/Technology).
Compiled from various sessions at TechEd, I will run down the list of the major new features Windows Phone will include for developers in its next released (called Mango):
