C# Corner

Resources  
  • Naming Guidelines in .NETApr 20, 2001. Commenting and following a uniform naming guidelines in your code is one of good programming practices to make code more useful.
  • Ouch! There is a Hook in My C#May 15, 2001. As an extension to the J++ design practice, C# has a syntactic construct, called Attributes, which let you drop hooks to Windows API or modify the runtime semantics, like threading synchronization behavior. The C# has legalized the hooking practice by calling them Attributes, and including them in ECMA C# specification.
  • Using WebRequest and WebResponse classesJul 31, 2001. Downloading and uploading data from the web has been a very common programming practice these days.
  • Factory Patterns in C#Dec 10, 2001. The FACTORY METHOD PATTERN comes under the classification of Creational Patterns. The creational patterns deals with the best way to create objects.
  • Prototype Patterns in C#Dec 26, 2001. The PROTOTYPE PATTERN comes under the classification of Creational Patterns. The creational patterns deals with the best way to create objects. This helps to copy or clone the existing objects to create new ones rather than creating from the scratch.
  • The CodeLib ProgramAug 26, 2002. Reusability of code is one of the common practice in a programmer's daily life.
  • Singleton Patterns in C# RevisedDec 16, 2002. I am coming from the Java world, where synchronizing the Singleton creation is common practice.
  • Extreme Programming (XP)Feb 18, 2004. Extreme Programming (XP) is a discipline of software development based on values of simplicity, communication & feedback. It works by bringing the whole team together in the presence of simple practices.
  • Generics in C#Mar 08, 2004. Parametric Polymorphism is a well-established programming language feature. Generics offers this feature to C#. The best way to understand generics is to study some C# code that would benefit from generics.
  • Building Applications with .NET Compact FrameworkJun 09, 2004. In this article, author explains various components of Microsoft .NET Compact Framework and how to build compact device applications using .NET Compact Framework.
  • Cryptography in .NETJul 31, 2004. This article gives a brief overview of Cryptography and the Cryptography support provided by the .NET Framework. I begin by introducing Cryptography and then proceed to examine the various types of it. In particular, I review and analyze the various cryptography algorithms and objects supported by .NET. I conclude after proposing and briefly discussing the algorithmic technique that would work best for you.
  • Moving to ASP.NET: Part 1Aug 24, 2004. The attached white paper, Moving to ASP.NET, examines trends in the adoption of ASP.NET, and provides guidelines for selecting the migration approach that best meets specific business needs.
  • Crystal Reports - Geterogeneus databases: SQL Server, Oracle, Unidata, BtrieveAug 24, 2004. Crystal Reports is the most flexible tool on the market and it has market recognition. Multiple software vendors offer Crystal Reports as the main reporting tool: Microsoft, Best Software, Oracle to name a few. In this article, you learn some tips on using Crystal Reports versus other options.
  • How to work with Assemblies in InstallShield Developer 7.0Oct 14, 2004. InstallShield Developer 7.0 is the best solution for providing the very easy user interface to author installations having both .NET and side by side components. This article is a step by step walk through of how to create a deployment project using InstallShield.
  • Best Practices of Exception ManagementMar 08, 2005. Exception management is one of the key area for all kinds of application development .You should adopt an appropriate strategy for exception management to build high quality and robust application .It is a very powerful concept and makes the development work very easy if its used efficiently.
  • Best Approach for Designing Interoperable Web ServiceMar 15, 2005. This article will clarify and explain in detail the different Web Service Design Methodologies as defined by the Web Services Standardization Groups, clarify the terms, highlight their differences.
  • Best Practices of CodingApr 13, 2005. This document covers a few recommendations to leverage the quality of the code in .NET using FXCop 1.30 and how to write custom rules through an introspection engine.
  • Microsoft patterns & practices: The Enterprise LibraryJul 06, 2005. Microsoft patterns & practices provide scenario-specific recommendations illustrating how to design, develop, deploy, and operate architecturally sound applications for the Microsoft .NET platform.The following article covers details on the Data Access Application Block.
  • Microsoft patterns & practices: The Enterprise LibraryJul 12, 2005. Microsoft patterns & practices provide scenario-specific recommendations illustrating how to design, develop, deploy, and operate architecturally sound applications for the Microsoft .NET platform.The following article covers details on the Data Access Application Block.
  • Enterprise Library Caching Application BlockJul 12, 2005. Microsoft patterns & practices provide scenario-specific recommendations illustrating how to design, develop, deploy, and operate architecturally sound applications for the Microsoft .NET platform. The following article covers details on the Caching Application Block.
  • New Dataset features in ADO.Net 2.0Aug 22, 2005. ADO.NET class libraries are used for accessing data from a wide range of data sources. One of the best features in ADO.Net is DataSet.Even though it was an exciting feature, performance was a concern with DataSet. Lets look some changes made to DataSet in ADO.Net in this article.
  • Navigating Data Grid using Client ScriptingNov 10, 2005. It's very common practice to use the Data Grid to present data over web pages. Though the Data Grid is provides the richer UI presentation if not coded and handled effectively it can have great performance issues. This article gives the code sample for navigating the data grid using the Client Scripting (thereby can be used for lots of validation before doing the Post Back to the server) and minimizing the round trip to server
  • Template for Designing Web ApplicationNov 14, 2005. This article explains to develop a web application with ease and make it more robust and scalable.
  • Agile Development Checklist Feb 20, 2006. The purpose of this article is to define a set of ideal practices for an agile software development project. The idea for this article came to me after discussing CMMI-type processes and realizing that there is no agile equivalent.
  • A Glance at Web Application SecurityMar 07, 2006. Web application security involves implementing protective measures against potential threats, malicious or unintentional, that exploit exposed vulnerabilities. Security is best implemented using the defence-in-depth technique by applying protective measures at network, host, and web application levels. This article will focus on security at the application level by exploring IIS and ASP.net authentication, authorization and secure communication.
  • Internationalization Getting StartedMar 09, 2006. This article introduces the concept of Internationalization in application development. Starting off with the basics of character encoding and Unicode, the article discusses the best practices to be followed in writing culture aware code and designing Internationalized user interfaces with adequate examples in .NET (C#).
  • How to Automatically Send a Resolution Optimized Markup of a Web Page to the ClientApr 15, 2006. This article will tell you about a technique through which you can make intelligent ASP.NET websites which will automatically detect the resolution of the visitor's desktop and generate a resolution optimized mark-up of a page, not forcing the visitor to keep the resolution of his/her desktop according to the website's best view resolution.
  • Prototype Design Pattern: Easy and Powerful way to copy objectsMay 05, 2006. This article mainly focuses on the Prototype design pattern along with advantages and possible practical scenarios where this pattern seems to be the best choice.
  • Best Practices of Compact FrameworkMay 17, 2006. This shares a few recommendations for use in our day to day development of Compact Framework applications.
  • Random isn't Really Random -- C# Random Number GenerationJul 18, 2006. This article covers overriding the System.Random object in order to produce better random numbers. The project file contains a library of eight commonly used random number generating algorithms, the best of which is the Mersenne Twister algorithm.
  • Best practices for .Net Performance - IAug 03, 2006. This article gives you an overview of best practices to attain .Net performance.
  • Practical Approach to Computer System Design and ArchitectureOct 13, 2006. The article gives an introduction to system designing and architecture by introducing a new concept that allow beginners to easily break and design complex software systems using a modular based development approach with a pattern, which we all practice in our day to day life.
  • A guide to ObjectDataSource controlNov 17, 2006. One of the best new features of the forthcoming ASP.NET 2.0 will be the ObjectDataSource control. However, as I found out in my experimentation what seems like a simple control has some complex behaviours to master to get it working properly. If (like me) you have an existing data access layer you may have to make changes to be able to use ObjectDataSource.
  • Leveraging the "using" keyword in C#Jan 17, 2007. The “using” keyword in C# is one of the best friends of programmers but many of us may not realize this. The “using” keyword is used in two cases – First when importing a namespace in your code and second in a code block.
  • Knowing When to Leave Your Programming Job - Part IJun 21, 2007. This article is the first part in a series to guide you in deciding when it's best to leave your Programming Job. Part I addresses a host of myths that are associated with staying at a dead-end job, and how to combat them.
  • Best Practices for handling exceptionsSep 18, 2007. This article shall explain some of the best practices when you deal with exceptions.
  • Best Practices for Data Transfer in SQL Server 2005Jun 23, 2008. This article talks about some best practices and the process of data transfer in SQL Server 2005.
  • Application Architecture for .NET ApplicationsJan 08, 2009. This Article series helps the .NET developers and architects to design the effective applications on .NET latest technologies. There are so many articles,books on application architecture but it is still challenging for developers to understand best practices, principles for the application design. This post speaks about the fundamentals concepts of Application Architecture and principles.
  • Make thumbnail image using ASP.NetFeb 12, 2009. This article explains the best ways to create thumbnail images dynamically in Asp.Net.
  • Integrating LDAP Active Directory into your .Net Web Portal (C# or VB.NET)Mar 04, 2009. This article will guide you through the best practices and method of using LDAP Active Directory as your user store for credentials and account information in your web applications or portal that you will develop in C# or VB.Net.
  • Retaining your best peopleApr 25, 2009. You can replace equipment, infrastructure, tools, etc but at the end of the day it’s the people i.e. human capital which is the critical success factor in today’s competitive environment. Retaining key talent is one of the topmost priorities for all successful managers.
  • Faster Performance of Deployed ASP.Net SitesMay 14, 2009. This article provides a few tips to ensure your deployed ASP.Net always runs with the best possible performance and no security information leakages.
  • Analizing data to best customers using Crystal ReportsMay 22, 2009. In the sales analysis, there is a principle named the Pareto principle also known as the 80-20 rule. The 80-20 rule states that 80% of the effects come from the 20% of the causes and then the remaining 20% effects come from 80% of the causes. Pareto observed that 80% of the land in Italy was owned by 20% of the population. One example in the IT world is that Microsoft has noted that 20% of the most reported bugs are the causes of the 80% of the errors or crashes of the systems. After Pareto observed this principle, a lot of application appeared. One of the most common applications of the Pareto principle is in the sales analysis. Companies perform analysis in their sales orders in order to discover the best customers, that is, the 80% of the sales come from the 20% of the customers. In this article, I will show how to perform a sales analysis using Crystal Reports. For this example, we will use the AdventureWorks database shipped with SQL Server 2005.
  • XML Diff and Patch using LINQ to Xml and LINQ to ObjectsJul 26, 2009. This article focuses on working with XML and how to get best out of LINQ to XML and LINQ to Objects. Focus of this article is to you show the power of LINQ to Xml and get you started on LINQ with practical examples.
  • How to turn a mobile device into a mighty survey assistantJul 29, 2009. Marketing research and perfect customers’ knowledge are key factors for successful business. One of the best ways how to get to know your customers and their preferences is running surveys. Usually, the surveys are run by mobile workers using paper based forms. It might sound archaic, yet there are companies that use this manual approach. However, this outdated process can be easily replaced using mobile devices allowing data processing automation.
  • Handling Service Side Exception and Faulty Channel at Client Side in WCFAug 04, 2009. In this article, I will show different approach to deal with service side exception and channel fault at client side. I will do a comparison study between various approaches and I will provide best approach also.
  • .NET Best Practice No: 1:- Detecting High Memory consuming functions in .NET codeAug 15, 2009. This article discusses the best practices involved using CLR profiler for studying memory allocation.
  • .NET Best Practice No: 2:- Improve garbage collector performance using finalize/dispose patternAug 23, 2009. In this article we will first understand the concept of generations and then we will see the finalize dispose pattern. I am sure this article will change your thought process regarding destructor, dispose and finalize.
  • Guide to Improving Code Performance in .NET: Part IISep 01, 2009. This article explains about better Exception Handling practices in C#.
  • .NET Best Practice No: 3:- Using performance counters to gather performance dataSep 02, 2009. This article discusses how we can use performance counter to gather data from an application. So we will first understand the fundamentals and then we will see a simple example from which we will collect some performance data.
  • Best technique of sending bulk email.Sep 10, 2009. This article describe how to send bulk email
  • Best Practice No 4:- Improve bandwidth performance of ASP.NET sites using IIS compressionSep 16, 2009. Bandwidth performance is one of the critical requirements for every website. In today's time major cost of the website is not hard disk space but its bandwidth. So transferring maximum amount of data over the available bandwidth becomes very critical. In this article we will see how we can use IIS compression to increase bandwidth performance.
  • Best Practices No 5: Detecting .NET application memory leaksSep 29, 2009. In this article we are going to detect the .NET application memory leaks.
  • SQL Query Optimization FAQ Part 1 (With video explanation)Feb 02, 2010. In this article we will first try to understand what is a SQL plan, how is it created and then we will move towards understanding how to read the SQL plan. As we read the SQL plan we will try to understand different operators like table scan, index seek scan, clustered scan, RID lookup etc. We will also look in to the best practices associated with clustered and non-clustered indexes and how they function internally. We will practically see how indexed views increase performance and in what scenarios we should use the same.
  • Bad Practices: Locking on Non-shared Objects in Multi-threaded ApplicationsApr 24, 2010. In this article we will see one of the bad practices developers always do.
  • Customized Exception Handling May 05, 2010. In this article you will learn how to use Customized Exception Handling Using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
  • Knowing When to Leave Your Programming Job - Part IJul 16, 2010. This article is the first part in a series to guide you in deciding when it's best to leave your Programming Job. Part I addresses a host of myths that are associated with staying at a dead-end job, and how to combat them.
  • A Potentially Helpful C# Threading ManualJul 27, 2010. The article will focus on threading constructs and as such, is meant for both the beginner and those who practice multithreading regularly.
  • How to Get a New Job in 20 DaysSep 08, 2010. Successfully implemented and proven processes and best practices to get your dream job quickly.
  • ReSharper - The Magic Bullet For Visual StudioNov 03, 2010. If you are doing coding on a daily basis then ReSharper for Visual Studio is a life changing product. With ReSharper you will see a change in productivity and maintainability in your programming practices. Read on to see how ReSharper can help you.
  • Introducing Web Client Software Factory (WCSF)Nov 25, 2010. The Web Client Software Factory is a framework for developing ASP.NET and Ajax applications implementing proven patterns and practices. This framework is part of Microsoft Patterns & Practices.
  • Best Practices in .NET XML Serialization of Complex ClassesDec 06, 2010. This article will show you XML serialization, so simply added in code, is not a magical stick. Serialization must be planned in full detail when working with complex classes, rather than expected to work by itself. Loss of planning work leads to redesign work later on, when maintaining serialization of original classes becomes too expensive or even hits the limit after which serialization of original classes is not possible without loss of data.
  • Best Practices Using Windows Forms ComboBox ControlDec 15, 2010. This article discusses several ways in which Windows Forms ComboBox control can be populated when DropDownList style is used. Some of the methods are discouraged, some highly appreciated, all depending on the way in which objects are mapped to strings shown in the ComboBox drop list.
  • WCF: Error Handling and FaultExceptionsJan 12, 2011. This article reviews WCF error handling: FaultExceptions, FaultCodes, FaultReasons and custom FaultExceptions and then discusses best practices for error handling.
  • Debugging, Tracing and Instrumentation in .NET and ASP.NET (14 FAQ)Jan 28, 2011. Diagnosing a software application is an art and this art has to be more skillful when in production. In the development environment you have the complete VS IDE tool so diagnosing is much easier. In a production environment as a best practice you do not install Visual Studio IDE. So in production it’s like fighting with a Lion without a knife.
  • MVVM in WPFFeb 24, 2011. In this article, I'll review some of those best practices for designing and implementing client applications with WPF. By leveraging some core features of WPF in conjunction with the Model-View-ViewModel (MVVM) design pattern.
  • Comparison of MVC implementation between J2EE and ASP.NET, Who is the best? Part 1Mar 19, 2011. This article is a comparison of MVC implementation between J2EE and ASP.NET.
  • CMMI (Capability Maturity Model Integration)Mar 23, 2011. CMMI defines practices that businesses have implemented on their way to success. Practices cover topics that include collecting and managing requirements, formal decision making, measuring performance, planning work, handling risks, and more.
  • Best SharePoint Upgrade PracticesMar 24, 2011. Before planning a SharePoint upgrade, certain key points carry importance for a successful implementation.
  • How do you convert numbers to wordsMar 29, 2011. There are many solutions to converting numbers to words, the best one is a matter of choice, the bigger the number, the more you have to deal with, or do you!
  • Comparison of Who is the Best? MVC Implementation Between J2EE Struts 2 & ASP.NET MVC 2 - Part 2May 06, 2011. This article will compare the frameworks of Java and ASP.NET.
  • Efficient Implementation of Minimum and Maximum Functions with Application in GUI DesignMay 18, 2011. This article provides ready-to-use solutions to the problem and explains several examples where a proposed solution proves to be useful in practice.
  • Track Last Login of a WebSite VisitorMay 23, 2011. In this article you will learn the best way to track and update the last login date and time of a site visitor.
  • Experiencing SQL Server 2008 Database Projects in Visual Studio 2010May 31, 2011. This article explains or gives a small introduction to the new project template available under .NET Framework 4. Here, I am trying my best to explain the template because I am also exploring and learning this new template.
  • Proper Usage of Form.AcceptButton and Form.CancelButton Properties in Windows Forms ApplicationsAug 03, 2011. In this article we will first pass from simple to more complex cases which programmers might encounter in practice and then provide a full scale solution to the problem of maintaining AcceptButton and CancelButton properties in form of ready-to-use set of classes. Finally, we will provide an example which demonstrates how simple it is to use these classes.
  • Advances in .NET Event HandlingAug 09, 2011. This article covers several situations that occur in practice when coding event driven applications. Pitfalls and bad designs are outlined and examples of proper event handling are given.
  • Auditing Events in .NET ApplicationsAug 12, 2011. In this article we are pushing further down into murky depths of .NET event driven application internals. Several concepts used to implement event subscriptions in practice (all strictly based on MSDN) will be explained and their functioning used to implement otherwise hardly implementable entity: event auditor.
  • Silverlight Chart Control - Part 1Aug 28, 2011. In this article we are going to see how we can use the Silverlight Chart Control to create Charts which are always the best way of data visualization.
  • Rarely used keywords in CSharp but Frequently asked in discussions [Beginners]Sep 15, 2011. There are a few words that we rarely use in day to day C# practices [I’m focusing readers who are beginners]. But I’ve seen them in either online exams or other IT quiz shows. So I came to write something about those untouched keywords.
  • ScaffoldColumn(bool value) vs HiddenInput(DisplayValue = bool value) in MVCNov 11, 2011. In this article, we will see what the use of ScaffoldColumn and HiddenInput. We will also compare what the key differences between these two attribute and what scenario we should consider these attributes for usage. So, accordingly prior to my articles on MVC we will just add these attributes and we will see what the best we can produce.
  • Simple And Best Way of Implementing the Repository PatternJan 02, 2012. I will try to explain in a very simplest method to understand repository pattern.
  • Image Overlay Using JQueryFeb 08, 2012. In this article we will create an image overlay effect using jQuery. jQuery is already very popular because it is a fast and concise JavaScript library that simplifies HTML document traversing, event handling, animation, and AJAX interactions with very little code. With jQuery you can enjoy a new way of web development and image galleries are the best way to use it effectively.
  • Arrays in CFeb 09, 2012. Arrays are a linear data structure that stores the same type of data in contiguous memory locations. Arrays are best used to store data in contiguous memory locations.
  • Easiest and Best Way to Use WCF OData Services and Silverlight ClientFeb 10, 2012. The Open Data Protocol (OData) is an open protocol for sharing data, based on Representational State Transfer (REST). In this article, I would like to explain OData using WCF.
  • Create Template Using VSIX in Visual StudioFeb 18, 2012. In this article I would like to show the steps in creating a multiple project template inside Visual Studio. Visual Studio is one of the best Programming IDEs in the market and it provides vast amount of extensibility.
  • Good Practices to Write Stored Procedures in SQL ServerMar 01, 2012. This explains the good practices for writing stored procedures in SQL Server and the advantages of writing stored procedures.
  • How to Configure Parental Controls in Windows 8Apr 08, 2012. Parental controls is one of the best tools available in Microsoft’s operating systems. Parental control is used to protect your children from using system and also restricting the period they use it.
  • Converting Cardinal Numbers to Ordinal using C#Apr 09, 2012. A problem which often arises in practice is how to convert a cardinal number to its ordinal equivalent.
  • How to Configure Best Bet in SharePoint 2010 SearchMay 01, 2012. In this article, I am showing you how to configure Best Bet in Search.
  • Implementing an Image Library in SharePoint 2010Jun 19, 2012. Here we can create a new image library. Viewers need to search and filter the images to find the best image for their needs.
  • Web Development 2012: Game Changing Technologies and Tools From MicrosoftJun 19, 2012. Instead of focusing on code samples, goal of this article is to talk about best choices of tools technologies in overly confused development world out there. Article is targeted for general audience in software industry: Project Managers, developers, architects.
  • Implementing a Video Library in SharePoint 2010Jun 20, 2012. We can create a new video library to support marketing videos. Viewers need to search and filter the images to find the best image for their needs.
  • Test Driven Development BasicAug 04, 2012. In this post we will see how we can go about Test Driven Development, there are many advantages practicing TDD, we’ll just cover basics to start with.
  • Display App in Full Screen With Windows TaskbarAug 05, 2012. In this article we will learn to do the above mentioned task step-wise, we will change the form style so that we don’t have any borders as in traditional windows forms app, we will also find out the width of windows taskbar and also the location of the taskbar so that our app occupies the best fit location on the screen.
  • ASP.NET Best PracticesSep 03, 2012. In this article we will explore some of the best practices in ASP.NET development.
  • ASP.NET Performance PracticesSep 03, 2012. In this article we will explore some tips for improving ASP.NET performance.
  • jQuery UI Datepicker in MVC 4 IssueOct 28, 2012. Today, I spent couple of hours in finding the best suited fix of this issue. Actually that was a very simple problem and we may fix it by adding another http request layer in the application but that was not a productive choice.
  • Abstract Factory Pattern in VB.NETNov 10, 2012. The abstract factory pattern comes under the classification of Creational Patterns. The creational patterns deals with the best way to create objects. The Abstract Factory provides an interface to create and return one of several families of related objects.
  • Best Way to Prevent Cross Site Request Forgery Attacks in MVC 4Mar 15, 2013. In this article you will learn what Cross Site Request Forgery (CSRF) is and is the best way to prevent such attacks. After a quick introduction about CSRF I will show you an example where the attacker will change the profile information with one click.
  • Commonly Asked SQL QueriesMar 18, 2013. Here I am sharing some of the SQL queries which are commonly asked. I was practicing with such queries and wanted to know more from people.

About best-practice

NA

SPONSORED BY

File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!
Download Free eBooks