Esempio n. 1
0
        /// <summary>
        /// Creates a new SQL Server database connection based on the connection string specified in the data source.
        /// </summary>
        /// <param name="source">The data source containing the connection string.</param>
        /// <returns>The new SQL Server database connection.</returns>
        protected static IDbConnection CreateConnection(DataSources source)
        {
            string connectionString = StateManager.Settings[source.ToString()] as string;

            IDbConnection connection = new SQLiteConnection(connectionString);

            //            SetConnection(source, connection);

            return connection;
        }
Esempio n. 2
0
        private static IQueryParser Get(DataSources type)
        {
            IQueryParser parser;

            lock (_parserLock)
            {
                if (!Parsers.TryGetValue(type, out parser))
                {
                    parser = ObjectFactory.BuildUp<IQueryParser>(type.ToString());
                    Parsers.Add(type, parser);
                }
            }

            return parser;
        }