Read only vs Static vs Const
Const A variable declared as const must be assigned a value at declaration, and this value may not then change at a later time. public const string ConnectionString = "YourConnectionString" ; The value in a const variable is what's called a "compile-time" value, and is immutable (which means it does not change over the life of the program ). Only primitive or "built-in" C# types (e.g. int, string, double) are allowed to be declared const . Therefore, you cannot write either of these: public const DateTime DeclarationOfIndependence = new DateTime ( 1776 , 7 , 4 ) ; public const MyClass MyValue = new Class ( ) { Name = "TestName" } ; You want to use const when you have a variable whose value will not change, ever, during the time your application is being used. Further, any variable declared as const will also, implicitly, be declared static . But that begs the question: what does static...