Click here to Skip to main content
13,793,550 members

Best C# article of October 2011

This competition has ended

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.

You must sign in to participate in this contest.
This contest has ended.
1 Oct - 31 Oct 2011

Current Entries

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

30 Oct 2011
jim lahey
In response to Adrian Cole's comment to the OP - due to living and working in a country where there are four official languages, plus English as a de facto fifth, I've encountered this before.Provided you have the corresponding .resx files embedded in the same assembly as the enum and your...
18 Oct 2011
Andrew Rissing
Or you could just go the other direction and cache the known results ahead of time. You're only looking at 13 numbers in all, so it is not a big memory hog to just store those known values inside of the method and be done with it.static uint Factorial(uint x){ if (x > 12) throw...
18 Oct 2011
George Swan
The Regex method uses comma, full stop, hyphen, and apostrophe as word separators. The problem with this is that these characters are not universally used as separators. The hyphen is used to join two words. Could I suggest the following?string input = "Mr O'Brien-Smith arrived at 8.30 and...
23 Oct 2011
jkrebsbach
A way to combine data from two different sources into one datasource for SSRS reporting
28 Oct 2011
Yvan Rodrigues
The Open Graph protocol specifies additional meta tags that can be added to the page to supplement social networking sites with more information about your page.
14 Oct 2011
Julien Villers
Nice tip! I'm also a proponent of using your friend the preprocessor to stop you from making big mistakes, along with your best friend, the compiler.You can combine both using this alternative code:private bool ValidateUserDetails(string userName, string password){ //TODO: Default value...
5 Nov 2011
Frank Augustin
Describe validation when presenting data in WPF Toolkit’s DataGrid.
17 Oct 2011
Ankush Bansal
C# Polymorphic types conversion with Generics
25 Oct 2011
KeithAMS
I am writing a service at present and have written a few over the years. What I do now is put all the code in a separate DLL from the start off. My service methods Onstart, OnStop call into the DLL which starts a thread to do the work.For debugging, I have a separate test harness console app...
18 Oct 2011
Sergio Andrés Gutiérrez Rojas
Easy FTP Upload without files size limit
16 Oct 2011
Panos Rontogiannis
For reference types, the hash is based on an internal counter that is incremented every time a descendant of System.Object is created. This happens in System.Object's constructor.For value types (structs), the hash is based on the first field. So if the first field is immutable, then you don't...
20 Oct 2011
jim lahey
I prefer to use ToTraceString() on the ObjectQuery:http://msdn.microsoft.com/en-us/library/system.data.objects.objectquery.totracestring.aspx[^]It's less intrusive as I don't have to instantiate and dispose the StreamWriter and I have more control over where and how I log the resultant...
24 Oct 2011
AlexCode
1 alternative  
Adding support for IHttpHandler on ASP.NET Routing
23 Oct 2011
zenwalker1985
I find Organize Usings -> Remove and Sort option much more useful than Just using Remove Usings. After it sorts, the using statements looks nice. :) In case you don't want to install any addins.
30 Oct 2011
A. Duman
1 alternative  
Usage of a TrackBar as a ToolStripMenuItem
2 Oct 2011
Gary Bilkus
How to get Silverlight 4 to display dates by default using the regional settings in the Control Panel.
9 Oct 2011
Luc Pattyn
I don't mind multiple exits in such a simple method, hence I'd write:public static bool Equals(this DateTime now, DateTime then, DatePartFlags flags) { if ((flags & DatePartFlags.Ticks) != 0 && now.Ticks != then.Ticks) return false; ... if ((flags & DatePartFlags.Month) != 0...
12 Oct 2011
Rupesh Kumar Tiwari
I have below suggestions:1) Why are you making call to webmethod are you fetching data from server and showing it in tool tip ? But in your example it seems that you are just returning the same data that you get from UI. If you are making some DB call and returning data to UI then its ok to...
24 Oct 2011
rj45
1 alternative  
Export whole page to Excel with infragistics
19 Oct 2011
Manjuke Fernando
This is a common issue that development teams face when reports are being deployed to the production environment.
25 Oct 2011
Jacobs76
I also use a Regex expression to count words, which returns the same number of words as MS Word. I wrap the Regular Expression in a String extension method to make it easy to use.public static class StringExtensions{ /// /// WordCounts Regular Expression /// ...
25 Oct 2011
jim lahey
Along similar lines to KeithAMS, when writing a Windows service, I only use the Windows Service Project as a container to run code that is in one or more referenced assemblies. As far as I'm concerned, if I've got any logic that goes beyond starting and stopping the service in my service...
25 Oct 2011
orouit
This article demonstrates how to write a licensing provider for .NET licensing that gets licenses from a Gemalto .NET Card V2.
30 Oct 2011
Marvin Bland
The other option to review when you receive this error is to view your Application_Pools setting for the app_pool you are using for your application.Check the "Enable 32-Bit Applications". If this is "False", change it to "True". This may resolve your issue.
2 Oct 2011
Mohammad A Rahman
Rename all the files from the given folder using C#. The code will go through all the files and rename with the same name but with formatted name for example by removing "-" or "_" etc with given characters..
2 Oct 2011
Vishnu Kesaraju
Using LINQ to XML to convert datatables to formatted XML.
4 Oct 2011
kct
Here with generics:public static string ToString(this T obj, Func toStringFunction) { return toStringFunction(obj); }You can use it like this:Console.WriteLine(person.ToString(p=>p.Name));
5 Oct 2011
brad.ford@cudl.com
Why limit it to IList, instead of IEnumerable?public static class ListExtension{// This is unnecessary as any collection that implement IList will also implement IEnumerable// public static void ForEach(this IList list, Action function)// {// foreach (T...
5 Oct 2011
Rob2412
Eric,Thank...
9 Oct 2011
Colin3
Using the SAPBusinessObjects.WPF.Viewer.dll, the property ShowGroupTree is not available.To Hide the GroupTree as a default, set the property .ToggleSidePanel to SAPBusinessObjects.WPF.Viewer.Constants.SidePanelKind.None.e.g.With _viewer .IsEnabled = True ...
7 Oct 2011
Rob Lyndon
A utility class that lets you store a set of days of the week in a single int value
10 Oct 2011
zenwalker1985
Using the Facade Pattern to simplify application design
19 Oct 2011
zenwalker1985
Structural design pattern
19 Oct 2011
ARBebopKid
My preference for run-time speed is:long Factorial(int input){ if (input 1; input--) { if (long.MaxValue - answer < answer) throw new...
13 Oct 2011
zenwalker1985
Structural Design Pattern (Part 3)
10 Jan 2013
Pawel Gielmuda
How to set orientation to landscape mode for XNA game in mixed mode (Silverlight & XNA)
18 Oct 2011
BruceCarson
public class MsTSCLib2 : AxMSTSCLib.AxMsTscAxNotSafeForScripting{ public MsTSCLib2() : base() { } protected override void WndProc(ref System.Windows.Forms.Message m) { //Fix for the missing focus issue on the rdp client component if (m.Msg ==...
20 Oct 2011
zenwalker1985
Good practice in method design
20 Oct 2011
Colin Eberhardt
An implementation of IPagedCollectionView which allows paging of data from the server
20 Oct 2011
Manjuke Fernando
How to show properties of a class on a PropertyGrid
24 Oct 2011
Gary H Guo
Discusses the Fluent interface to register aspects to a component and a method to chain aspects to an object for AOP Container.
26 Oct 2011
Pascal Ganaye
Provides a couple of hash functions (string to int) that will return the same value in C# and T-SQL
27 Oct 2011
rj45
You can simplify this by doing the following:/// /// Render/// /// protected override void Render(HtmlTextWriter writer){ if (Session[ExcelExport] != null && bool.Parse(Session[ExcelExport].ToString())) { ...
3 Dec 2012
Dave Kerr
A consistent approach to Commands, Asynchronous Commands, and Events-to-Commands for WPF, Silverlight, and WP7.
24 Oct 2011
Anoop Madhusudanan
Explains how to use C# as a scripting language in your .NET applications using Roslyn.
31 Jan 2012
Marcelo Ricardo de Oliveira
A Windows Phone application using accelerometer emulator and Farseer physics engine
12 Jul 2012
Christopher Diggins
An introduction to creating programming language tools using C# 4.0.
8 Nov 2011
Kanasz Robert
This article is about library for scripting SQL Server database objects and examples representing how this library can be used.
13 Oct 2011
Brij
This article discusses the basics of Claim based Authentication. This is the first part of the Series.
28 Oct 2011
Pijush kumar Joardar
Create a Workflow in Microsoft Dynamic CRM 4.0
You must sign in to participate in this contest.
This contest has ended.
1 Oct - 31 Oct 2011

Current Participants

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

A. Duman
Turkey Turkey
No Biography provided
AlexCode
Architect
Switzerland Switzerland
Senior IT Consultant working in Switzerland as Senior Software Engineer.

Find more at on my blog.
Andrew Rissing
Software Developer (Senior)
United States United States
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.

So..If you're not moving forward, you're moving backwards.
Ankush Bansal
Software Developer (Senior)
India India
No Biography provided
ARBebopKid
Software Developer State of Arkansas & Zycron
United States United States
Bryan Lee learned to code on a RadioShack Color computer II.
brad.ford@cudl.com
United States United States
No Biography provided
Brij
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
BruceCarson
Software Developer (Senior) Bluestone Consulting Group
United States United States
No Biography provided
Christopher Diggins
Software Developer Autodesk
Canada Canada
This article was written by Christopher Diggins, a computer science nerd who currently works at Autodesk as an SDK specialist.
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

-
Colin3
New Zealand New Zealand
No Biography provided
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.
Frank Augustin
Germany Germany
No Biography provided
Gary Bilkus
United Kingdom United Kingdom
No Biography provided
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.
George Swan
Student
Wales Wales
No Biography provided
Jacobs76
Software Developer (Senior)
France France
No Biography provided
jim lahey
Software Developer (Senior)
United Kingdom United Kingdom
First batch file in 1987

Messed around with the Bullfrog C++ Libraries for Syndicate in 1994

Web Developer since 2000

.net Developer since 2001

MCTS: Microsoft® .NET Framework 2.0 - Web-based Client Development

MCTS: Web Applications Development with Microsoft .NET Framework 4
jkrebsbach
Software Developer (Senior) Superior Consulting Services
United States United States
Jeff Krebsbach has been a Consultant with Superior Consulting Services (SCS) since 2006. SCS is based in Burnsville, Minnesota and focuses on developing solutions for Microsoft technologies, with a strong set of experience with MS SQL Server, SSRS, SSIS, and SSAS.
Julien Villers
Team Leader Multicam Systems
France France
No Biography provided
Kanasz Robert
Architect The Staffing Edge & Marwin Cassovia Soft
Slovakia Slovakia
My name is Robert Kanasz and I have been working with ASP.NET, WinForms and C# for several years.
MCSD - Web Applications
MCSE - Data Platform
MCPD - ASP.NET Developer 3.5
- Web Developer 4
MCITP - Database Administrator 2008
- Database Developer 2008
MCSA - SQL Server 2012
MCTS - .NET Framework 3.5, ASP.NET Applications
- SQL Server 2008, Database Development
- SQL Server 2008, Implementation and Maintenance
- .NET Framework 4, Data Access
- .NET Framework 4, Service Communication Applications
- .NET Framework 4, Web Applications
MS - Programming in HTML5 with JavaScript and CSS3 Specialist

Open source projects: DBScripter - Library for scripting SQL Server database objects


Please, do not forget vote
kct
Germany Germany
No Biography provided
KeithAMS
Software Developer
United Kingdom United Kingdom
No Biography provided
Luc Pattyn
Software Developer (Senior) Perceler
Belgium Belgium
I am an engineer with a background in electronics, software and mathematics.

I develop technical software, both for embedded systems and for desktop equipment. This includes operating systems, communication software, local networks, image processing, machine control, automation, etc.

I have been using all kinds of microcontrollers and microprocessors (Intel 4004/8080/8051/80386/Pentium, Motorola 680x/680x0/ColdFire/PowerPC, Microchip PIC, Altera NIOS, and many more), lots of programming languages (all relevant assemblers, Fortran, Basic, C, Java, C#, and many more), and different operating systems (both proprietary and commercial).

For desktop applications and general development tools I have been using both UNIX systems and Mac/MacOS for many years, but I have switched to x86-based PCs with Windows, Visual Studio and the .NET Framework several years ago.

I specialize in:
- cross-platform development (making software that runs on diverse hardware/OS combinations)
- instruction set simulation
- improving software performance, i.e. making sure the software runs the job at hand in as short a time as possible on the given hardware. This entails algorithm selection, implementation design, accurate measurements, code optimisation, and sometimes implementing virtual machines, applying SIMD technology (such as MMX/SSE), and more.
Manjuke Fernando
Technical Lead Air Liquide Industrial Services (Singapore)
Singapore Singapore
My passion lies in building business intelligence and data-based solutions, writing about things I work with and talking about it. New technologies relevant to my line of work interest me and I am often seen playing with early releases of such technologies.

My current role involves architecting and building a variety of data solutions, providing database maintenance and administration support, building the organization’s data practice, and training and mentoring peers.

My aspiration over the next several years is to achieve higher competency and recognition in the field of Data Analytics and move into a career of data science.


Specialities: SQL Server, T-SQL Development, SQL Server Administration, SSRS, SSIS, C#, ASP.Net, Crystal Reports
Marvin Bland
United States United States
No Biography provided
orouit
Architect Connect In Private
Singapore Singapore
Software Architect, COM, .NET and Smartcard based security specialist.

I've been working in the software industry since I graduated in Electrical and Electronics Engineering. I chose software because I preferred digital to analog.

I started to program with 6802 machine code and evolved to the current .NET technologies... that was a long way.

For more than 20 years I have always worked in technical positions as I simply like to get my hands dirty and crack my brain when things don't go right!

After 12 years in the smart card industry I can claim a strong knowledge in security solutions based on those really small computers!
I've been back into business to design the licensing system for the enterprise solution for Consistel using a .NET smart card (yes they can run .NET CLR!)

I'm currently designing a micro-payment solution using the NXP DESFire EV1 with the ACSO6 SAM of ACS. I can then add a full proficient expertise on those systems and NFC payments.
This technology being under strict NDA by NXP I cannot publish any related article about it, however I can provide professional consulting for it.

You can contact me for professional matter by using the forum or via my LinkedIn profile.
Panos Rontogiannis
Software Developer
Greece Greece
No Biography provided
Pascal Ganaye
Software Developer (Senior)
France France
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.
Pawel Gielmuda
Software Developer ABB
Poland Poland
No Biography provided
Pijush kumar Joardar
Software Developer (Senior)
India India
No Biography provided
rj45
Software Developer (Senior)
Canada Canada
No Biography provided
Rob Lyndon
Software Developer (Senior) SpiegelSoft
United Kingdom United Kingdom
No Biography provided
Rob2412
Switzerland Switzerland
No Biography provided
Rupesh Kumar Tiwari
Software Developer (Senior)
United States United States

I am a Senior Software Developer working since 2005 in Microsoft ASP.Net and related Technologies.


I work on C#, Asp.Net, MVC, RAZOR, Entity Framework, JavaScript, jQuery, HTML5, CSS3, WCF, Silverlight, WPF, MVVM, SQL, SSIS, etc. Did Function Point Analysis, WBS to estimate projects and worked on Agile Scrum team.



I enjoy on exploring new technologies by implementing and writing about them, great interest in learning Design Patterns and their implementations. I love learning, writing JavaScript; now my favorite JavaScript library is jQuery. I enjoy writing jQuery Plugins and core JavaScript. I also write Technical blogs here. You can find me on LinkedIn.



I wrote an article on Swami Vivekananda posted his audio speeches by reading them.

Sergio Andrés Gutiérrez Rojas
Systems Engineer Motion-Soft CO
Colombia Colombia
Systems engineer
Software developer
Networks technologist
Artificial vision, AI and robotic lover
Technology enthusiast
Gammer

Motion Soft Co-funder

MIA PC Friend Developer:
http://www.serg3antsoft.net63.net/MIAEng.html
Vishnu Kesaraju
United States United States
No Biography provided
Yvan Rodrigues
Systems Engineer Clearpath Robotics
Canada Canada
Yvan Rodrigues has 25 years of experience in information systems and software development for the industry. He is Senior Systems Developer at Clearpath Robotics

He is a Certified Technician (C.Tech.), a professional designation granted by the Institute of Engineering Technology of Ontario (IETO).

Yvan draws on experience as owner of Red Cell Innovation Inc., Mabel's Labels Inc. as Manager of Systems and Development, and the University of Waterloo as Information Systems Manager.

Yvan supports open-source software. He is a committer for SharpKit (C# to Javascript cross-compiler) and WebIssues (Issue/Ticket Management System), TinyMCE (JavaScript editor), and contributes to MySQL, Ghostscript, iTextSharp, Bacula, FreeBSD, and Xamarin.
zenwalker1985
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 Oct - 31 Oct 2011
You must sign in to participate in this contest.
This contest has ended.
1 Oct - 31 Oct 2011
You must sign in to participate in this contest.
This contest has ended.
1 Oct - 31 Oct 2011

Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.181207.3 | Last Updated 1 Oct 2011
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid