Click here to Skip to main content
14,694,532 members
This competition has ended

Best C# article of September 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.
11 Sep 2011
Anshul Mehra
This article provide APIs & functionality so that Excel Quits after automation
Please Sign up or sign in to vote.
15 Sep 2011
Reiss
1 alternative  
A guide on how to call overload constructors in C#
Please Sign up or sign in to vote.
26 Sep 2011
MBigglesworth79
A good primer for getting into serialization
Please Sign up or sign in to vote.
18 Sep 2011
Monjurul Habib
How to add namespaces for Razor pages
Please Sign up or sign in to vote.
31 Mar 2017
Dan Colasanti
AutoResetEvent can be used in place of AsyncWaitHandle and provides a thread-blocking WaitOne signaled timeout function, which can be put on a background thread in order to not block the main UI thread.
Please Sign up or sign in to vote.
3 Sep 2011
Sofa Team
Step by Step conversion of an application into a Docking application component
Please Sign up or sign in to vote.
12 Sep 2011
girijaa
A covariant type parameter can be used as the return type of a generic delegate/interface, and contravariant type parameters can be used as input parameter types.
Please Sign up or sign in to vote.
15 Sep 2011
Nathan Stiles
A class written to easily handle long paths (32K in length) using .NET.
Please Sign up or sign in to vote.
11 Sep 2011
brunofer2007
Easy way to sort nodes in a TreeView using a recursive function.
Please Sign up or sign in to vote.
20 Sep 2011
Raymund Macaalay
Simple TSQL and C# entity generator for S#arp architecture
Please Sign up or sign in to vote.
23 Sep 2011
Ercan Anlama
Introduces how to integrate and use the validation block features in Microsoft Enterprise Library 5.0 with WCF.
Please Sign up or sign in to vote.
30 Sep 2011
Bill Anderson
Hi,Thanks for the feedback for alternative #1 from above (and thank you, Jurgen Rohr for your suggestion! I replaced the "reset" line with:while (!sieveContainer.Get(++marker));factor = marker;Here is another algorithm that's slightly different. It's not as elegant an approach, but...
Please Sign up or sign in to vote.
7 Sep 2011
Eric Xue (brokensnow)
How to resolve SharePoint document locked for editing issue
Please Sign up or sign in to vote.
6 Sep 2011
EmitsorGrp
Automatically generate a Windows Phone 7 settings page.
Please Sign up or sign in to vote.
30 Sep 2011
BobJanova
1 alternative  
How to wrap a value type so it can be used in positions where a reference type is required
Please Sign up or sign in to vote.
22 Sep 2011
smoore4
Loop through all files in a folder/subfolders and run a checksum that is stored in a database. E-mail descrepancies and results.
Please Sign up or sign in to vote.
12 Sep 2011
Bill Anderson
Here's an alternative. This one uses the BitArray class in C# and does not use the % operator.static List SeiveWithoutMod(int candidate){ BitArray sieveContainer = new BitArray(candidate + 1, true); int marker = 2; //start int factor = 2; //start. sieveContainer[0]...
Please Sign up or sign in to vote.
18 Sep 2011
ninasalimi
View States in .NET
Please Sign up or sign in to vote.
15 Sep 2011
NeoModulus
For when you want CRUD quick and don't care how you get it.
Please Sign up or sign in to vote.
16 Sep 2011
Kunal Chowdhury «IN»
Pinging a network IP or Hostname is not available in Silverlight. But you can do this using WCF service. In this post, I am going to implement the same thing for you.
Please Sign up or sign in to vote.
13 Sep 2011
Gary H Guo
Add AOP capabilities to Windsor Container by configuration using Dynamic Decorator
Please Sign up or sign in to vote.
15 Sep 2011
kribo
System.Windows.Forms.ColorDialog in a small WPF project TextEditor.
Please Sign up or sign in to vote.
3 Oct 2011
Adam Covitch
It is common to configure back-end database tables to contain a column with an auto-generated ID unique to each row. This tip describes how to sync the ID generated by the database back to the application layer.
Please Sign up or sign in to vote.
13 Sep 2011
Pete O'Hanlon
How I coded the Scrubber command that’s available in the new version.
Please Sign up or sign in to vote.
2 Oct 2011
Mohammad A Rahman
The List class already has a method doing the same job as:public static void ForEach(this IList list, Action function)More about the ForEach method is available here. Here is the reflected ForEach method:public void ForEach(Action action){ if (action == null) { ...
Please Sign up or sign in to vote.
15 Sep 2011
ChunkyStool
The alternative posted by Daaron does not work for several cases. E.g. Sign is included (+ or -), text contains whitespace prefix or suffix, etc. You could fix the first two limitations with a more detailed regex like "(^\s*(-|\+)?\d+\s*$)" but you could still end up with a value that won't fit...
Please Sign up or sign in to vote.
18 Dec 2011
SwarnenduDas
How to fetch an image document from FileNet for a known Document ID
Please Sign up or sign in to vote.
28 Sep 2011
Ram Balak Sharma
1 alternative  
Useful when calling a C# method from JavaScript by using JSON which returns a DataTable.
Please Sign up or sign in to vote.
21 Sep 2011
Anshul R
Private Sub GetIPAddress()Dim strHostName As StringDim strIPAddress As StringstrHostName = System.Net.Dns.GetHostName()strIPAddress = System.Net.Dns.Resolve(strHostName).AddressList(0).ToString()MessageBox.Show("Host Name: " & strHostName & "; IP Address: " &...
Please Sign up or sign in to vote.
30 Sep 2011
Mohammad A Rahman
Following might be another way to do the job:public static string ConvertDataTableToString(this DataTable dt){ StringBuilder stringBuilder = new StringBuilder(); dt.Rows.Cast().ToList().ForEach(dataRow => { ...
Please Sign up or sign in to vote.
22 Sep 2011
nlarson11
On Vista/Win 7, I have seen code where only a single period is returned for (0). This makes sure you get the actual IP regardless of the system.Const IPPattern As String = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"With Dns.GetHostEntry(System.Environment.MachineName) Return...
Please Sign up or sign in to vote.
6 Sep 2011
Karl Shifflett
Simplifying Prism WPF Navigation – Synchronous Navigation Confirmation
Please Sign up or sign in to vote.
19 Sep 2011
Gary H Guo
Discuss how to add AOP capabilities to IoC containers using a configurable model of Dynamic Decorator
Please Sign up or sign in to vote.
13 Sep 2011
jgauffin
How to get clean and flexible model + validation localization in ASP.NET MVC3
Please Sign up or sign in to vote.
16 Sep 2011
kribo
WPF dynamic TabControl - TabItems
Please Sign up or sign in to vote.
6 Sep 2011
Steve L. Powell
The need for speed: Excel Buffer Class
Please Sign up or sign in to vote.
28 Sep 2011
Muhammad Shahid Farooq
No need to write piece of code in Visual Studio 2008 and greater for single instance of your program or application. Go to the project properties and checked the check box "Make single instance application".
Please Sign up or sign in to vote.
2 Sep 2011
jgauffin
A set of best practices helping you to get the most out of your container
Please Sign up or sign in to vote.
2 Oct 2011
Mohammad A Rahman
In addition, there are many articles posts that have been discussed about this, for example,Single Instance Application in C#[^]Single-Instance C# Application - for .NET 2.0[^]Stream Decorator, Single-Instance Apps[^]
Please Sign up or sign in to vote.
23 Sep 2011
Anshul R
See this for implementing Singletonhttp://msdn.microsoft.com/en-us/library/ff650316.aspx[^]
Please Sign up or sign in to vote.
15 Sep 2011
A.J.Wegierski
Trick to remove an event handler out of the scope of the handler
Please Sign up or sign in to vote.
26 Feb 2013
Dave Kerr
Create Solitaire and Spider Solitaire for WPF, step by step.
Please Sign up or sign in to vote.
17 Sep 2011
Henry He
In this article, I will explain how to use DataAnnotations library's validation feature for domain entity with a simple demo application.
Please Sign up or sign in to vote.
23 Sep 2011
Andrew Kirillov
The article describes an algorithm for recognition of optical glyphs in still images and video and then shows its application in 3D augmented reality.
Please Sign up or sign in to vote.
1 Sep 2011
Reiss
2 alternatives  
A handy way to stub methods in development, but preventing them from being shipped in release mode.
Please Sign up or sign in to vote.
21 Sep 2011
Colin Eberhardt
This article describes the development of XAML Finance, a cross-platform application which works on the desktop, using Windows Presentation Foundation (WPF), on the web, using Silverlight and on Windows Phone 7 (WP7).
Please Sign up or sign in to vote.
20 Sep 2011
Soroush Falahati
Introducing a class for generating 3D images (Stereoscopic and Anaglyph) from DepthMaps.
Please Sign up or sign in to vote.
12 Jan 2012
Shai Raiten
TV Screen in the Reception, When nothing happens (no one is in the reception) we can display videos on the screen but when someone enters the frame show him the Kinect Image, and if the user is doing something funny, capture his image and save it.
Please Sign up or sign in to vote.
5 Feb 2018
Stas Wolski
This article describes how to implement a meeting room booking system in an ASP.NET MVC project with dhtmlxScheduler.
Please Sign up or sign in to vote.
14 Sep 2011
Abhijit Jana, Abhinav S
Frequently asked questions on ASP.NET GridView at CodeProject Question Answer forums.

Current Participants

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

Kunal Chowdhury «IN»
Technical Lead
India India

Kunal Chowdhury is a former Microsoft "Windows Platform Development" MVP (Most Valuable Professional, 2010 - 2018), a Codeproject Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Senior Technical Lead by profession.

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows app development. He posts his findings, articles, tutorials in his technical blog (www.kunal-chowdhury.com) and CodeProject.


Books authored:


Connect with Kunal on:




A.J.Wegierski
Web Developer
Poland Poland
Complicated
Abhijit Jana
Technical Lead
India India
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| Technology Evangelist | Author | Speaker | Geek | Blogger | Husband

Blog : http://abhijitjana.net
Web Site : http://dailydotnettips.com
Twitter : @AbhijitJana
My Kinect Book : Kinect for Windows SDK Programming Guide
Adam Covitch
United States United States
No Biography provided
Andrew Kirillov
Software Developer IBM
United Kingdom United Kingdom
Started software development at about 15 years old and it seems like now it lasts most part of my life. Fortunately did not spend too much time with Z80 and BK0010 and switched to 8086 and further. Similar with programming languages – luckily managed to get away from BASIC and Pascal to things like Assembler, C, C++ and then C#. Apart from daily programming for food, do it also for hobby, where mostly enjoy areas like Computer Vision, Robotics and AI. This led to some open source stuff like AForge.NET, Computer Vision Sandbox, cam2web, ANNT, etc.

Going out of computers I am just a man loving his family, enjoying traveling, doing some sports, a bit of books, a bit of movies and a mixture of everything else. Always wanted to learn playing guitar, but it seems like 6 strings are much harder than few dozens of keyboard’s keys. Will keep progressing ...
Anshul Mehra
Architect
United States United States
I am not only a technology consumer, but a technology contributor also. I keep my self engaged with at-least 2 dev projects (in personal capacity) at any time. My strength is at providing robust and better solution. I can write full scale (product grade) softwares, tools & libraries. I am an avid knowledge seeker and always keep my self updated with the latest framework stacks on Python, .Net, Java and C++ technologies.
Anshul R
Student
India India
No Biography provided
Bill Anderson
Web Developer
United States United States
Developer
BobJanova
United Kingdom United Kingdom
I'm a recent graduate (MSci) from the University of Cambridge, no longer studying Geology. Programming is a hobby so I get to write all the cool things and not all the boring things Smile | :) . However I now have a job in which I have to do a bit of work with a computer too.
brunofer2007
Software Developer (Senior) Martifer Inovação e Gestão
Portugal Portugal
No Biography provided
ChunkyStool
Software Developer Insight Global
United States United States
No Biography provided
Colin Eberhardt
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

-
Dan Colasanti
President ImproviSoft LLC
United States United States
Dan is the Founder and President of ImproviSoft LLC (mobile software) and AdStreamer, Inc. (mobile advertising) - both Microsoft BizSpark Plus Startups.

Dan holds a B.S. in Computer Science from Clarkson University and M.S. degrees in Computer Science and Computer Engineering from Syracuse University. He is an ASQ Certified Software Quality Engineer (CSQE) and was a 2012 Microsoft XNA/DirectX MVP.

Prior experience includes Software Engineering, Project Management, and Functional Management in the Aerospace & Defense, Medical Devices, Automotive Engineering, and e-Commerce industries.

Dan's dev-blog is The ImproviSoft Blog.
Dave Kerr
Software Developer
United Kingdom United Kingdom
Follow my blog at www.dwmkerr.com and find out about my charity at www.childrenshomesnepal.org.
EmitsorGrp
Software Developer (Senior) Emitsor Group
Mexico Mexico
Focused on creating MS Windows 8, Silverlight, Windows Phone 7 & 8 and the Web applications.

More than 20 years of experience creating software solutions.
Ercan Anlama
Software Developer
Turkey Turkey
I am interested in innovation and creativity in software development and passionate in learning new stuff.
Eric Xue (brokensnow)
Architect F-Tech Software
Australia Australia
Eric has more than 10 years’ experience within the IT industry, specialising in designing and implementing solutions using Microsoft technology stack.

He’s currently working with SharePoint 2010/2013, Tableau, OBIEE, QlikView, SAP BusinessObjects Enterprise XI 3.1/XI 4.0, SAP BusinessObjects Dashboards 4.0 (Xcelsius Enterprise 2011), FAST Search 2010 for SharePoint, Dynamics CRM2011/4.0, .NET 3.5/4.0/4.5, Asp.net Ajax, SQL Server 2008R2/2012/2014, SSIS, SSAS, SSRS and DQS.

With a passion for learning cutting-edge technologies and constantly updating his existing skills set, Eric’s project experience covers all area of software consulting including pre-sales, analysis, design and implementation.

You could catch me via linked-in http://au.linkedin.com/in/ericxuesydney or my blog
Gary H Guo
United States United States
Object-oriented (OO) is about "classes" not "objects". But I truly believe that "objects" deserve more our attentions. If you agree, read more on... Dynamic Object Programming (DOP), Component-Based Object Extender (CBO Extender), AOP Container and Dynamic Decorator Pattern.

Mobile development is not just another type of front end. The real challenge is actually in the back end: How to present meaningful information in time to mobile users with exponentially increased data flooding around? Here is my first mobile solution: SmartBars - Barcode Reader, Price Comparison and Coupons.

Gary lives in southeast Michigan. My first programming language is FORTRAN. For the last a few years, I have primarily focused on .NET technologies with Mobile Development as my newest interest.
girijaa
Technical Lead Mastek
India India
A Software professional with expertise in developing applications using Microsoft Stack [.Net 2.0/3.0/3.5/4.0] , SQL Server 2005/2008 , Asp.Net [Webforms,MVC] , Entity Framework , WPF , Winforms , Enterprise Library .
Knowledge of Sharepoint [MOSS 2007] and SQL Server BI and still learning ...
Henry He
Software Developer (Senior)
United States United States
Senior Software Developer from New Jersey, USA

Have 15+ years experience on enterprise application development with various technologies.
jgauffin
Founder 1TCompany AB
Sweden Sweden
Karl Shifflett
Architect
United States United States

I’m a passionate Software Architect and Developer.


A long-time WPF-Prism fanatic who enjoys writing line of business applications, developer tools, and Visual Studio Extensions.


My front end passions are WPF, Electron, Node.js, WordPress, and Angular.


For the back end I use what is appropriate for the project: SQL Server and ASP.NET WebAPI, Azure, etc.


I am very pragmatic software engineer and strive to write simple, maintainable, and testable code. Simple code allows for solving complex problems in a maintainable way.


My Blog


My Github Repros


Just a grain of sand on the worlds beaches.

kribo
Web Developer
Belgium Belgium
Developer within C#, Dynamics NAV (Navision), Php environments.
MBigglesworth79
Web Developer
United Kingdom United Kingdom
No Biography provided
Monjurul Habib
Software Developer (Senior)
Singapore Singapore
A life-long-learner, maker and soft music fan. Likes building things to solve problems. Years of successful records serving mid and large scale .NET applications in domestic and international client environment. Expertise in different areas of software development life cycles and Software Architecture.

Always looks for new technology and loves to get hands dirty Smile | :)
Muhammad Shahid Farooq
Software Developer (Senior) ForeVision Business Solutions
Pakistan Pakistan
Software Engineer | System Integrator | Architect

Muhammad Shahid Farooq is a software engineer with having experience of 9+ years of working on ADO.Net, C#.Net, VB.Net, VB6/VBA, SQL Server, Oracle, MySQL and other latest technologies. He holds Bachelor’s degree in Computer Science from the University of Central Punjab, Lahore, Pakistan. To contact Shahid, email him at muhammadshahidfarooq@yahoo.com.
Nathan Stiles
Web Developer
United States United States
No Biography provided
NeoModulus
Software Developer NeoModulus Consulting, LLC
United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.
ninasalimi
United States United States
No Biography provided
nlarson11
Architect GBIS
United States United States
No Biography provided
Pete O'Hanlon
CEO
United Kingdom United Kingdom
A developer for over 30 years, I've been lucky enough to write articles and applications for Code Project as well as the Intel Ultimate Coder - Going Perceptual challenge. I live in the North East of England with 2 wonderful daughters and a wonderful wife.

I am not the Stig, but I do wish I had Lotus Tuned Suspension.
Ram Balak Sharma
Architect Q3 technology
India India
Ram is .Net Architect by profession and passion having 8 year experience. He has extensive experience on Microsoft Development Platform and is also Microsoft Certified Application Developer (MCAD) for Web.
Reach me at rsharma@stackdotnet.com

http://www.stackdotnet.com/
6 Freely avaliable E-Books/
Raymund Macaalay
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/
Reiss
Program Manager
United Kingdom United Kingdom
No Biography provided
Shai Raiten
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.

My Blog: http://blogs.microsoft.co.il/blogs/shair/
smoore4
Database Developer
United States United States
I am an MBA with a bunch of MS certifications. Technically, I am a DBA, but I do a good deal of sys admin work and web development using .NET. I like to focus on business intelligence, database design, messaging architectures, and web services.
Sofa Team
United States United States
No Biography provided
Soroush Falahati
Chief Technology Officer
Iran (Islamic Republic of) Iran (Islamic Republic of)
Coding PHP, Asp.Net, C#, VB6, VB.Net and C++,

Web && Software Senior Developer.
Stas Wolski
Software Developer (Senior)
Russian Federation Russian Federation
Building web apps since 2001. Rich experience in HTML frontends for different platforms.
Steve L. Powell
Software Developer Excel Adviser
Canada Canada
I am a freelance software developer with a variety of different interests. My main area of expertise is Microsoft Office add-ins (Excel/Outlook mostly) but I also develop Windows applications, Access Databases and Excel macros . I develop in VBA, C# and C++. My website exceladviser.com has articles on Excel, Access, Microsoft Office development, and general Windows programming (WPF, etc.).
SwarnenduDas
Technical Lead
United States United States
No Biography provided
You must sign in to participate in this contest.
This contest has ended.
1 Sep - 30 Sep 2011