Пример #1
0
        /// <summary>
        /// GetConnestionStringXMLSetting()
        /// Busca en el archivo app.config el connectionstring de la base
        /// </summary>
        /// <returns>string</returns>
        public static string GetConnestionStringXMLSetting()
        {
            try
            {
                FacturaElectronica.DBEngine.SQLEngine sqle = new SQLEngine();

                System.Configuration.Configuration config =
                    System.Configuration.ConfigurationManager.OpenExeConfiguration(sqle.GetPath());

                System.Configuration.KeyValueConfigurationElement keyvalue =
                    config.AppSettings.Settings[KEYCONNECTIONSTRING];

                if (keyvalue.Value == null)
                {
                    throw (new Exception("Error: Archivo de Configuration es incorrecto o no existe (FacturaElectronica.DBEngine.dll.config)"));
                }

                return keyvalue.Value;
            }
            catch (Exception ex)
            {
                throw (new Exception(ex.Message));
            }
        }
Пример #2
0
 /// <summary>
 /// GetpathConfig()
 /// Publica el path de busqueda de la dll se usa en tiempo de ejecucion
 /// </summary>
 /// <returns>string</returns>
 public static string GetpathConfig()
 {
     FacturaElectronica.DBEngine.SQLEngine sqle = new SQLEngine();
     return sqle.GetPath();
 }