Click here to Skip to main content
13,594,948 members
Click here to Skip to main content
Add your own
alternative version


19 bookmarked
Posted 18 Mar 2006
Licenced CPOL

Easy Naming Practices for .NET Coding

, 18 Mar 2006
Rate this:
Please Sign up or sign in to vote.
While writing codes for .NET applications, if you and your team members contain some common naming practices, it becomes very useful, especially when you're reading your existing codes and modifying your codes in Visual Studio .NET IDE.


While writing codes for .NET applications, if you and your team members have some common naming practices, it becomes very useful especially when you're reading your existing codes and modifying your codes in Visual Studio .NET IDE. For naming conventions, I went to the MSDN site, but got so many links which made me a bit frustrated to read all the stuffs by spending couple of hours. However I have used my Microsoft Word application and very quickly written some naming conventions, which can be read and can be used very quickly. My team has found it fruitful; I believe you can find it useful as well.

UI Naming Prefix

1Buttons btn
2DropDownList ddl
3LinkButton lnb
4Label lbl
5Repeater rpr
6DataGrid dgd
7CheckBox chk
8RadioButton rdo
9DataList dls
10Image img
11TextBox txt
12ImageButton imb
13HyperLink hln
14ListBox lst
15Panel pnl
16PlaceHolder phd
17Calendar cnd
18AdRotator art
19Table tbl
20RequiredFieldValidator rfv
21CompareValidator cmv
22RangeValidator rgv
23RegularExpressionValidator rev
24CustomValidator csv
25Validation Summary vsm

Casing of Codes

Name Space Name CaseNameSpaceName
Class Naming CaseClassName
Method Naming CaseMethodName
Property Naming CasePropertyName
Enum CaseEnumName
Enum MembersEnumMemberName
Constant Name CaseConstantName
Local Variable Naming CasevariableName
Param Variable Naming CaseparamName
Region NamesRegion name will be sentence case like this.
Code CommentsComments will be in general case like this.
Private Data_privateDataName


Tables, Relations

Table Name Prefixtbl
Table Name CasetblTableName
Primary Key NamePK_tblNameID
Foreign Key NameFK_'ForeignKeytblName'ID

Stored Procedure

Stored Procedure Prefix

  • spr_StoredProcedureName

NOTE: Starting by sp_ prefix causes performance overhead.

CRUD (Create-Read-Update-Delete) Stored Procedures Names

READ BY PRIMARY KEYspr_tblTableName_GetByPrimaryKey
READ BY FOREIGN KEYspr_tblTableName_GetBy'KeyName'
READ ALLspr_tblTableName_GetAll

NOTE 1: This standard groups the stored procedures by table wise cluster, which facilitates changes on a table schema modification in the stored procedure layer.

NOTE 2: For multiple table CRUD operation, use the following example:
INSERT: spr_tblTableName[1_tblTableName2_...tblTableNameN ]_Insert

Other Database Objects

Function Name Prefixfnc_
Trigger Name Prefixtrg_
Cursor Name Prefixcrs_
View Name Prefixviw_

CRUD [Create-Read-Update-Delete] Methods of Data Access Class


  • CreateEntityName
  • UpdateEntityName
  • DeleteEntity
  • GetAllEntityName
  • GetEntityNameById
  • GetEntityNameBy'KeyName'

NOTE: For DAL/BLL when there is a separate class for each entity, we can exclude the entity name from the method names.


  • FieldName

Property Constants

  • _FieldName

Method Parameter that is Assigned to Property

  • fieldName


Any advice or correction for this article will be highly appreciated.


  • 18th March, 2006: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mohammad Ashraful Alam
Chief Technology Officer
Bangladesh Bangladesh
Mohammad Ashraful Alam is a Software Engineer, who is dedicated to Microsoft .NET based development. This Bangladeshi national is involved with project management and development of several US based software projects from his country. Already he has managed and developed 15 software projects, which are being used by several users of different countries, such as USA, Canada, Australia, and Bangladesh. While developing and managing a team, he contains and maintains a set of well defined engineering practices developed by him and other online developer community. Beside software development, he has also written several technical articles and research papers published by IEEE Computer Society and many other worlds recognized publishers.

Before becoming engaged with software development, he was involved with Bengali literature and several Bengali news papers as freelance journalist and published around 150 articles, essays and short stories.

Due to his willingness to give effort to improve and share better software development practices, Ashraf has awarded as “Most Valuable Professional” (MVP) in ASP.NET category by Microsoft for multiple times, since 2007.

When not engaged with technical stuffs, he likes to pass time with his friends, and family members, listens music or watches TV.

Check his portfolio at:

Check his blog:

Catch him thru mail: admin [attt] ashraful [dotttt] net (anti-spam text).

You may also be interested in...


Comments and Discussions

GeneralThis is an outdated way of thinking [modified] Pin
sngbrdb5-Jul-06 3:29
membersngbrdb5-Jul-06 3:29 
GeneralDisagree with database conventions Pin
hexy19-Mar-06 10:34
memberhexy19-Mar-06 10:34 
GeneralRe: Disagree with database conventions Pin
joycsc19-Mar-06 19:02
memberjoycsc19-Mar-06 19:02 
GeneralRe: Disagree with database conventions Pin
hexy19-Mar-06 22:19
memberhexy19-Mar-06 22:19 
GeneralNaming Practices. Pin
George L. Jackson19-Mar-06 5:02
memberGeorge L. Jackson19-Mar-06 5:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180621.3 | Last Updated 18 Mar 2006
Article Copyright 2006 by Mohammad Ashraful Alam
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid