Exemplo n.º 1
0
        // Check SQL Connection DAL
        public bool Check_Connection()
        {
            // Sql Connection String Check
            DB_Connection_String connection = DB_Connection_String.Get_Connection_String_Instance();

            if (connection.DBConnectionString != "" || connection != null)
            {
                using (SqlConnection DBconnection = new SqlConnection(connection.DBConnectionString))
                {
                    try
                    {
                        DBconnection.Open();
                        return(true);
                    }

                    catch (Exception)
                    {
                        return(false);
                    }
                }
            }

            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        // Get Singleton Instance
        public static DB_Connection_String Get_Connection_String_Instance()
        {
            if (ConnString_Instance == null)
            {
                ConnString_Instance = new DB_Connection_String();
            }

            return(ConnString_Instance);
        }