public sealed class GetDBInstance { private static readonly object padlock = new object(); private static DBCon _ObjInstance; public GetDBInstance() { } public static DBCon InstanceCon { get { if (_ObjInstance == null) { lock (padlock) { if (_ObjInstance == null) _ObjInstance = new DBCon(); _ObjInstance.strConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; } } return _ObjInstance; } } }
public class DBCon { public string strConnection { get; set; } }
using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)