Exemplo n.º 1
0
        private void formMainWindow_Load(object sender, EventArgs e)
        {
            Configuration        configuration = ConfiguratuionHelper.GetConfiguration(string.Empty);
            ConfigurationSection oracleSection = configuration.GetSection("oracle.manageddataaccess.client");

            MessageBox.Show(string.Format("Config File Path = [{0}]", ConfiguratuionHelper.GetCustomConfigFilePath()), "Custom Configuration File Path");

            string configFileName = ConfiguratuionHelper.GetExecutingAssemblyConfigFileName();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor which takes the connection string name
        /// </summary>
        /// <param name="connectionStringName"></param>
        public OracleDBAccessor(string connectionStringName)
        {
            Configuration        configuration = ConfiguratuionHelper.GetConfiguration(string.Empty);
            ConfigurationSection oracleSection = configuration.GetSection("oracle.manageddataaccess.client");

            string connectionString = configuration.ConnectionStrings.ConnectionStrings[connectionStringName].ConnectionString;

            _connection = new OracleConnection(connectionString);
        }
Exemplo n.º 3
0
        private void btnConfiguration_Click(object sender, EventArgs e)
        {
            var ConnectionStrings = ConfiguratuionHelper.GetConfiguration(string.Empty).ConnectionStrings;

            if (ConnectionStrings != null && ConnectionStrings.ConnectionStrings["OracleConnection"] != null)
            {
                MessageBox.Show(string.Format("Oracle Connection Definition = [{0}]", ConnectionStrings.ConnectionStrings["OracleConnection"].ConnectionString), "Oracle Connection Info");
            }
            else
            {
                MessageBox.Show("There is no Oracle connection information defined!", "Oracle Connection Info");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor which takes "ExcelConnection"
        /// </summary>
        /// <param name="connectionName"></param>
        public ExcelDBAccessor(string connectionName)
        {
            if (string.IsNullOrWhiteSpace(connectionName))
            {
                throw new ArgumentNullException("connectionName");
            }

            Configuration configuration    = ConfiguratuionHelper.GetConfiguration(string.Empty);
            string        connectionString = configuration.ConnectionStrings.ConnectionStrings[connectionName].ConnectionString;

            this._connection     = new OleDbConnection(connectionString);
            this._connectionName = connectionName;
        }