Click here to Skip to main content
15,509,322 members
This competition has ended

Best C# article of July 2011

Contribute to CodeProject and you'll automatically be in the running for a monthly prize!

Each month at CodeProject we gather together the best of the articles submitted the previous month and ask our readers to choose the best of the best. Entry is automatic - just submit you articke and we'll do the rest.

Check out the submission guidelines for information on posting articles.

Current Entries

Articles that match the contest criteria are automatically entered. The top 50 entries are shown.

Please Sign up or sign in to vote.
9 Jul 2011Paulo Zemek
The easiest singleton pattern is the one you used to the lock object itself.Creating any variable as static readonly and initializing it directly (or via a static constructor) will already make it singleton.Also, considering that "lock" clears all the caches, you don't need to declare the...
Please Sign up or sign in to vote.
25 Jul 2011Praveen Kullu
An Attribute changer which can change attributes of files and folders
Please Sign up or sign in to vote.
26 Jul 2011Arjan van Dijk
Developing a small generic re-usable model using the highly flexible DC technology resulting in a fully functional mini-application
Please Sign up or sign in to vote.
8 Jul 2011Clifford Nelson
A special class is needed to support binding a set of flags to a View.
Please Sign up or sign in to vote.
20 Jul 2011Gil Fink
The post shows how to use the Geocode API in order to make an address lookup for a given location.
Please Sign up or sign in to vote.
12 Jul 2011RaisKazi
Walkthrough of Asp.Net Core Ajax
Please Sign up or sign in to vote.
3 Dec 2013Vangos Pterneas
How to create a WPF application performimg skeleton tracking.
Please Sign up or sign in to vote.
4 Jul 2011Nelson Kosta Souto
How to use key pressing on a form
Please Sign up or sign in to vote.
16 Jul 2011tsdragon
Application[“P...
Please Sign up or sign in to vote.
20 Jul 2011cmschick
Thanks for sharing. I have a similar utility with additional capabilities that some of you might find useful.using Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Diagnostics;using...
Please Sign up or sign in to vote.
6 Jul 2011Brian C Hart
This tip shows how to add support for New Horizontal Tab Group and New Vertical Tab Group commands to the Window menu of an application using the DockPanel Suite by Weifen Luo, and some other minor improvements to help decided if at least one of your windows is docked to the side of the main form an
Please Sign up or sign in to vote.
10 Jul 2011Mohammad A Rahman
Parse key/value of a Generic dictionary in C#.
Please Sign up or sign in to vote.
27 Jul 2011Ivan Krivyakov
BackgroundWorker and UI threads
Please Sign up or sign in to vote.
21 Jul 2011Ramanujam Shankar
Remove the triangle and star symbol from the row header in a DataGridView.
Please Sign up or sign in to vote.
23 Jul 2011#realJSOP
I wouldn't create a class for this. I'd make it an extension method, and then do this:public static class String Extensions{ public static string Reverse(this string value) { value = // do your reverse code here; return value; }}// Usage:string x...
Please Sign up or sign in to vote.
5 Jul 2011#realJSOP
I do it this way:0) Create a base page class, and store the current page's url (you can do this any number of ways, so I'll leave it to your imagination):public class MyBasepage : System.Web.UI.Page{ public string CurrentUrl { get; set; } }1) Store the page's Url to a...
Please Sign up or sign in to vote.
4 Jul 2011DrABELL
AsFYI: In addition to my previous comments, here is the link to an excellent article published by Aron Weiler on CodeProject addressing the same issue of Multi-Key Dictionary Object: C# Multi-key Generic Dictionary[^]
Please Sign up or sign in to vote.
7 Jul 2011#realJSOP
.Net 4 has the enum.HasFlag() method, which kinda obsoletes this tip. :)
Please Sign up or sign in to vote.
12 Jul 2011johannesnestler
I think your function is no (theoretical) replacement for the is operator.The is operator takes an object (left) and a type (right) as arguments, not two objects.The is operator considers inheritance. Look at this (executable) example:using System;namespace IsOperatorCheck{ ...
Please Sign up or sign in to vote.
15 Jul 2011Simon Bridge
Full code listing for a very simple but effective Colour-Combo (Color for those in America)
Please Sign up or sign in to vote.
19 Jul 2011Colin Eberhardt
How to create a conversation view, mimicking the SMS messaging interface within Windows Phone 7
Please Sign up or sign in to vote.
22 Jul 2011Brij
Generics and Constraints over Generics
Please Sign up or sign in to vote.
21 Jul 2011Gediminas Geigalas
Teleric MVC Grid ActionLink Column
Please Sign up or sign in to vote.
27 Jul 2011garymcleanhall
Towards better unit testing organization
Please Sign up or sign in to vote.
27 Jul 2011PeteBarber
Unit Testing C# Custom Attributes with NUnit
Please Sign up or sign in to vote.
27 Jul 2011PeteBarber
Unit Testing C# Custom Attributes with NUnit
Please Sign up or sign in to vote.
28 Jul 2011Qwertie
I want a conditional dot operator
Please Sign up or sign in to vote.
29 Jul 2011gsvolt
Draing a two-color line in Silverlight.
Please Sign up or sign in to vote.
1 Jul 2011Mahadesh Mahalingappa
In Part 2 of Dynamic Loading of objects, I have created a custom Dependency Injection Framework
Please Sign up or sign in to vote.
3 Jul 2011Dr.Walt Fair, PE
You can also use the method in the following article to insert any sort of binary file in your project resources and retrieve it. Create a blank Jet database[^]
Please Sign up or sign in to vote.
10 Jul 2011GAMerritt
Getting a DllImport of kernel32's GetFullPathName to work (C#).
Please Sign up or sign in to vote.
10 Jul 2011Chris Randle
I've always used var because ReSharper suggested it by default. However, like most people, I only did this when I didn't understand the conotations of ReSharper's suggestion. Now I disable this suggestion in the plug-in, and in actual fact, I prefer to use the fully qualified name on at least...
Please Sign up or sign in to vote.
15 Jul 2011Manoj Kumar Kota
Fetch Data from Google Analytics Service
Please Sign up or sign in to vote.
17 Jul 2011Philippe Mori
LINQPad is an interesting tool to try queries.LINQPad[^]Perfect tool to try out some alternatives for complex queries. As we can see generated queries and elapsed time, it help a lot to help having fast queries for complex requests.
Please Sign up or sign in to vote.
18 Jul 2011AspDotNetDev
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...
Please Sign up or sign in to vote.
20 Jul 2011Gil Fink
What Model Binders are in ASP.NET MVC and how you can use them in your MVC applications.
Please Sign up or sign in to vote.
21 Jul 2011Raymund Macaalay
How to get the default record type of a user for event creation in Salesforce
Please Sign up or sign in to vote.
23 Jul 2011Prerak Patel
What is new in this age old method? We can use LINQ too.Dim inputString As String = "Reverse me"Dim input() As Char = inputString.ToCharArrayDim result As String = New String((From i As Integer In Enumerable.Range(1, input.Length) _ Select...
Please Sign up or sign in to vote.
24 Jul 2011GAMerritt
A C# method for finding ratio Q/R approximating real numbers.
Please Sign up or sign in to vote.
25 Jul 2011garymcleanhall
Skyhooks are undesirable, how to replace them in your code.
Please Sign up or sign in to vote.
25 Jul 2011PeteBarber
A simple generic way to test Custom Attributes with NUnit.
Please Sign up or sign in to vote.
26 Jul 2011#realJSOP
One way to effectively zero the columns any DataRow object.
Please Sign up or sign in to vote.
29 Jul 2011Bob Sandberg
How would you do this, if objects included inside one of the serialized objects was an abstract class? E.g.:abstract class Base{ public int x;}class A : Base{ public int y;}class B : A{ public int z;}class SomeOtherClass{ public string...
Please Sign up or sign in to vote.
1 Jul 2011zenwalker1985
This article explains a refactored code snippet on passing parameters for a stored proecedure via SP schema rather than hard coding the column/param names.
Please Sign up or sign in to vote.
4 Jul 2011charles henington
[Serializable]...
Please Sign up or sign in to vote.
9 Jul 2011charles henington
Sending Email with Custom Control
Please Sign up or sign in to vote.
8 Jul 2011Amey1202
In WPF, just set the ToolPanelView property of CrystalReportViewer to None. That is enough.
Please Sign up or sign in to vote.
12 Jul 2011Paul Schwartzberg
Formatting XML in a string for visual presentation.
Please Sign up or sign in to vote.
16 Jul 2011Waleed Eissa
How to turn URLs into hyperlinks in ASP.NET and truncate long URLs in the link text
Please Sign up or sign in to vote.
18 Jul 2011SergeyT2
The codepublic static IEnumerable IfMatchWith(this IEnumerable myList, string itemToMatch){ foreach (var item in myList.Where(item => item == itemToMatch)) yield return item;}could be rewritten as:public static IEnumerable IfMatchWith(this...

Current Participants

Those with articles that match the contest criteria are automatically entered.

Software Developer (Senior) Paddedwall Software
United States United States
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.

My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) Distel Software B.V.
Netherlands Netherlands
Senior Developer and Technical Director at Distel Software B.V.(www.distel.nl)

About 15 years of IT experience in several languages (c++, c#, vb.net) specializing in framework oriented development
(using DC, DO and XAF/XPO) based on C# where the focus is on functional modeling and creating re-usable building blocks.
Web Developer
United States United States

  • Managing Your JavaScript Library in ASP.NET (if you work with ASP.net and you don't read that, you are dead to me).
  • Graduated summa cum laude with a BS in Computer Science.
  • Wrote some articles and some tips.
  • DDR ("New high score? What does that mean? Did I break it?"), ping pong, and volleyball enthusiast.
  • Software I have donated to (you should too):
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Team Leader
United States United States
Brian C. Hart, Ph.D., is a strategic engagement leader on a mission to leverage space technology to protect U.S. interests and assets against adversaries. Throughout Dr. Hart's career, he has enjoyed: Working closely with business executives to provide strategic direction and leadership, translating customer and competitive intelligence into compelling capture strategies and solutions, and mentoring teams to enhance individual and company capabilities while fostering an engaging and accountable environment, being involved in STEAM initiatives and education to develop greater awareness in the community, and serving the armed forces with the U.S. Navy and U.S. Army National Guard. He is excited to begin developing his career in Jacobs's Critical Mission Systems business unit, supporting NORAD and the U.S. Space Force.
Software Developer (Senior)
India India
Brij is a 3-times Microsoft MVP in ASP.NET/IIS Category and a passionate .NET developer. More than 6 years of experience in IT field, currently serving a MNC as a Tech Lead/Architect.

He is a very passionate .NET developer and have expertise over Web technologies like ASP.NET 2.0/3.5/4.0, jQuery, JSON, Javascript, IIS and related technologies. He is also a Exchange Server (EWS) Specialist. He has great experience in design patterns and N-Tier Architecture.

He is also certified as Microsoft Certified Technologies Specialist-ASP.NET and Microsoft Certified Technologies Specialist-WCF in .NET 4.0. He has also received several awards at various forums and his various articles got listed as "Article of the day" at ASP.NET Microsoft Official Website www.asp.net.

He has done MCA from NIT Durgapur and completed his graduation from Lucknow University.

Learning new technologies and sharing knowledge excites him most. Blogging, solving problems at various forums, helping people, keeps him busy entire day.


Visit his Blog: Code Wala

Area of Expertise :
C#, ASP.NET 2.0,3.5,4.0, AJAX, JQuery, JSON, XML, XSLT, ADO.Net, WCF, Active Directory, Exchange Server 2007 (EWS), Java script, Web Services ,Win services, DotnetNuke, WSS 3.0,Sharepoint Designer, SQL Server 2000/2005/2008
United States United States
I do not claim to be wrong! I just rarely ever write.
Software Developer (Senior) Crantech Solutions Ltd
England England
C# software developer who works predominantly with web technologies. Interested in business process improvement, psychology of user interfaces - specifically within content management systems, and the use of technology to advance our daily lives.
Software Developer (Senior) Clifford Nelson Consulting
United States United States
Has been working as a C# developer on contract for the last several years, including 3 years at Microsoft. Previously worked with Visual Basic and Microsoft Access VBA, and have developed code for Word, Excel and Outlook. Started working with WPF in 2007 when part of the Microsoft WPF team. For the last eight years has been working primarily as a senior WPF/C# and Silverlight/C# developer. Currently working as WPF developer with BioNano Genomics in San Diego, CA redesigning their UI for their camera system. he can be reached at qck1@hotmail.com.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Architect Scott Logic
United Kingdom United Kingdom
I am CTO at ShinobiControls, a team of iOS developers who are carefully crafting iOS charts, grids and controls for making your applications awesome.

I am a Technical Architect for Visiblox which have developed the world's fastest WPF / Silverlight and WP7 charts.

I am also a Technical Evangelist at Scott Logic, a provider of bespoke financial software and consultancy for the retail and investment banking, stockbroking, asset management and hedge fund communities.

Visit my blog - Colin Eberhardt's Adventures in .NET.

Follow me on Twitter - @ColinEberhardt

-
Engineer Comport Computing
United States United States
I am a software developer specializing in technical and numerical software systems and also a PhD Petroleum Engineer.
I started programming in IBM 1620 machine code in 1967, then FORTAN on CDC mainframes mainframes in 1970. I later used ALGOL, BASIC, FORTH, Pascal,Prolog, C, F#, C#, etc.
I generally use whatever language available thatallows me to accomplish what is neccesary.
Engineer
United States United States
Dr. Alexander Bell (aka DrABell) is a seasoned full-stack Software (Win/Web/Mobile) and Data Engineer. He holds PhD in Electrical and Computer Engineering, authored 37 inventions and published 300+ technical articles; currently focused on Microsoft Azure Cloud and Android Mobile development projects. Alex participated in App Innovation Contests (AIC 2102/2013) w/multiple winning submissions. Sample apps/publications:

  1. HTML5/CSS3 graphic enhancement: buttons, inputs
  2. HTML5 Tables Formatting: Alternate Rows, Color Gradients, Shadows
  3. Azure web app: Engineering Calculator VOLTMATTER
  4. Azure: NYC real-time bus tracking app
  5. Quiz Engine powered by Azure cloud
  6. 'enRoute': Real-time NY City Bus Tracking Web App
  7. Advanced CSS3 Styling of HTML5 SELECT Element
  8. Aggregate Product function extends SQL
  9. YouTube™ API for ASP.NET
United States United States
Writer, designer, inventor, musician, observer, and critic with many years of experience in each of these areas. I can do without the approval of "experts" because I believe candid statements and penetrating analysis bring greater rewards than a "pat on the back". And if I have something to say when you're not listening, I tell someone else about it.
Software Developer (Senior) Nephila Capital Ltd.
Bermuda Bermuda
An experienced .NET developer, currently working for Nephila Capital Ltd. in Bermuda. Author of "Pro WPF and Silverlight MVVM".
Software Developer (Senior)
Lithuania Lithuania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead sparXys
Israel Israel
Gil Fink is a web development expert and ASP.Net/IIS Microsoft MVP. He is the founder and owner of sparXys. He is currently consulting for various enterprises and companies, where he helps to develop Web and RIA-based solutions. He conducts lectures and workshops for individuals and enterprises who want to specialize in infrastructure and web development. He is also co-author of several Microsoft Official Courses (MOCs) and training kits, co-author of "Pro Single Page Application Development" book (Apress) and the founder of Front-End.IL Meetup. You can read his publications at his website: http://www.gilfink.net
Software Developer
United States United States
I am a software developer with a wide range of interests. Early in my career I started with Microsoft based technologies, did some Java, and am now again helping organizations with Microsoft based solutions.

My main goal in joining codeproject would be to post useful code that otherwise would not be available in Microsoft's documentation.
Technical Lead Thomson Reuters
United States United States
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.

Please visit my web site: www.ikriv.com.
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
Australia Australia
10+ years of experience in IT industry as Application developer and solution architect.
Software Developer
Australia Australia
Engineer
Portugal Portugal
My name is Nelson Souto, I develop software for fun and profit since 1992.
Software Developer (Senior) Systemize Informatik GmbH
Denmark Denmark
Software Developer / Contractor
Software Developer (Senior) Microsoft
United States United States
I started to program computers when I was 11 years old, as a hobbyist, programming in AMOS Basic and Blitz Basic for Amiga.
At 12 I had my first try with assembler, but it was too difficult at the time. Then, in the same year, I learned C and, after learning C, I was finally able to learn assembler (for Motorola 680x0).
Not sure, but probably between 12 and 13, I started to learn C++. I always programmed "in an object oriented way", but using function pointers instead of virtual methods.

At 15 I started to learn Pascal at school and to use Delphi. At 16 I started my first internship (using Delphi). At 18 I started to work professionally using C++ and since then I've developed my programming skills as a professional developer in C++ and C#, generally creating libraries that help other developers do their work easier, faster and with less errors.

Want more info or simply want to contact me?
Take a look at: http://paulozemek.azurewebsites.net/
Or e-mail me at: paulozemek@outlook.com

Codeproject MVP 2012, 2015 & 2016
Microsoft MVP 2013-2014 (in October 2014 I started working at Microsoft, so I can't be a Microsoft MVP anymore).
Team Leader
United Kingdom United Kingdom
My day job is mostly working in C++ with a bit of C#. I write a fair amount of command line based tools and really wish they could have a GUI front-end to them hence why I spend my spare time working with WPF.

I started a blog few years back but didn't do a lot with it. I've started describing some of the interesting programming things I come across on it. Please take a look.
Software Developer (Senior)
Canada Canada
Programmer at Maid LABS from 2003 (www.maidlabs.com)

Programmer-Analyst at Viasat Geo Technoligies from 1995 to 2002 (www.viasat-geo.com).

I have studied at École Polytechnique de Montréal in computer engineering.
Software Developer HP Microsystems
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer
India India
Working since 2006 on VBA, VB6, VB.Net, C#, ASP.Net, MSSQL




  • Courage is not the absence of fear, but rather the judgement that something is more important than fear.
  • The fear of suffering is worse than the suffering itself.
  • People need not fear the unknown if they are capable of achieving what they need and want.
  • Every blessing ignored becomes a curse.
  • Sometimes what's in your head isn't as crazy as you think.
  • We never really grow up, we only learn how to act in public.
  • You can make very bad teams with very good individuals.
  • Admitting mistakes means you have a sense of responsibility in your actions and that shows you are more matured than almost anyone. -Nithin

Software Developer None
Canada Canada
Since I started programming when I was 11, I wrote the SNES emulator "SNEqr", the FastNav mapping component, the Enhanced C# programming language (in progress), the parser generator LLLPG, and LES, a syntax to help you start building programming languages, DSLs or build systems.

My overall focus is on the Language of your choice (Loyc) initiative, which is about investigating ways to improve interoperability between programming languages and putting more power in the hands of developers. I'm also seeking employment.
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Software Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
Software Developer (Senior) Decipha
Australia Australia
Wrote his first computer game in Microsoft Basic, on a Dragon 32 at age 7. It wasn't very good.
Has been working as a consultant and developer for the last 15 years,
Discovered C# shortly after it was created, and hasn't looked back.
Feels weird talking about himself in the third person.
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
CEO LightBuzz
United States United States
Vangos Pterneas is a Microsoft Most Valuable Professional in the Kinect technology. He helps companies from all over the world grow their revenue by creating profitable software products. Vangos is the founder of LightBuzz Inc. and author of two technical books.
Software Developer (Senior) Contractor
Egypt Egypt
My name is Waleed Eissa and I'm a software developer from Cairo, Egypt. I spent 7 years developing software for the banking industry, but has changed focus in recent years to Web development. I specialize in Microsoft technologies, esp. ASP.NET and C#, and am passionate about everything web. My main interests are user experience design (UX), performance tuning and scalability.

Website: http://www.waleedeissa.com
Blog: http://waldev.blogspot.com
Software Developer (Senior) Siemens
India India
A .net developer since 4+ years, wild, curious and adventurous nerd.

Loves Trekking/Hiking, animals and nature.

A FOSS/Linux maniac by default Wink | ;)

An MVP aspirant and loves blogging -> https://adventurouszen.wordpress.com/
You must sign in to participate in this contest.
This contest has ended.
1 Jul - 31 Jul 2011