How to use constants in .NET?
I have a written this Dev tip for the new folk who entered in this Dev World. Normally in the development we use some of the success message's or failure messages in general common message's.We do have a habit of writing the messages as given below MessageBox.Show("Successfully created a record!"); MessageBox.Show("Successfully deleted a record!"); We can make use of Constants in .NET which will be declared using the keyword " const ".For the above scenario we can create a class like "Messages.cs" and define constants as given below public class Messages { public const string strUserExist = "User Name already exists."; public const string strUserSaved = "User information saved successfully."; public const string strUserDeleted = "User deleted successfully."; } ...