Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why I can not make my Connection String a const?
Message
 
 
To
23/09/2008 16:53:51
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01349894
Message ID:
01405546
Views:
64
>A singleton is different pattern but it could be that if included within the class including a private constructor. The code I showed was basically a property in some other class using Lazy Instantiation. But the idea can be close. Here is an example of a singleton.
>
>
>public class RFIDReader
>{
>     #region Singleton
>     private static RFIDReader instance = null;
>     public static RFIDReader Instance
>     {
>          get
>          {
>               if(instance == null)
>                    instance = new RFIDReader();
>
>               return instance;
>          }
>     }
>
>     protected RFIDReader()
>     {
>          this.InitializeComponent();
>     }
>
>     #endregion Singleton
>}
>
Thanks again to everyone.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform