Exemplo n.º 1
0
        /// <summary>
        /// Comprueba la conexión a la basa de datos SMS
        /// </summary>
        private int checkSMS()
        {
            string nombreBD = System.Configuration.ConfigurationManager.AppSettings["NombreBDiSMS"];
            int estado;
            DataTable valores;
            try
            {
                estado = 0;
                valores = new DataTable();
                Consultas consulta = new Consultas();
                valores = consulta.getAutenticacion(nombreBD).Tables[0];
                consulta = null;

                if (valores.Rows.Count == 0)
                {
                    return estado;
                }
                else
                {
                    return estado = 1;
                }

            }
            catch (Exception Error)
            {
                throw (new Exception(Error.ToString()));
            }
        }