예제 #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;
        }
예제 #2
0
파일: QueryManager.cs 프로젝트: NLADP/ADF
        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;
        }