コード例 #1
0
ファイル: DbManager.cs プロジェクト: kvpz/Ideally-Connected
        protected DbManager(string databaseName) : this()
        {
            DatabaseName = databaseName;

            DbConfigSection config = (DbConfigSection)ConfigurationManager.GetSection("TestDatabases/" + databaseName);

            ConnectionString = config.DatabaseConfig.ConnectionString;

            SqlConnectionStringBuilder connectionStringBuilder = new SqlConnectionStringBuilder(ConnectionString);

            DataSource = connectionStringBuilder.DataSource;

            ServerConnection serverConnection = new ServerConnection(DataSource);

            serverConnection.DatabaseName = DatabaseName;

            Server server = new Server(serverConnection);

            _database = server.Databases[DatabaseName];

            UpdateProcedures();

            CsvFilePaths = new Dictionary <string, string>();
            foreach (TableElement t in config.Tables)
            {
                if (t.Name.Length > 1)
                {
                    CsvFilePaths.Add(t.Name, t.CsvFile);
                }
            }
        }
コード例 #2
0
 public SqliteAdapter(DbConfigSection config)
 {
     _connectionString = config.ConnectionString;
 }