Example #1
0
        public static void Initialize(string connectionString, Cache cache)
        {
            using(Logger.Scope("Initializing ServerModel"))
            {
                if (__ConnectionString != null)
                    throw new DMError("ServerModel is alredy initialized");

                __ConnectionString = connectionString;
                __Connection = new SqlConnection(connectionString);

                (DB = new DatabaseModel(__Connection)).Initialize(cache);
            }
        }
Example #2
0
        public TestFixtureDB()
        {
            var cB = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["IUDICO_TEST"].ConnectionString);
            _DataBaseName = cB.InitialCatalog;
            var cB2 = new SqlConnectionStringBuilder
            {
                DataSource = cB.DataSource,
                IntegratedSecurity = cB.IntegratedSecurity
            };
            if (cB.UserID != null && cB.Password != null)
            {
                cB2.UserID = cB.UserID;
                cB2.Password = cB.Password;
            }

            _ScriptsPath = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Environment.CurrentDirectory))), "DBScripts");
            _Connection = new SqlConnection(cB2.ToString());

            dm = new TestDatabaseModel(_Connection);
        }