コード例 #1
0
 public static void ResetDataSource()
 {
     var dbPath = SqlLoader.GetDatabaseDirectory("AdventureWorks_2012_LT_Script");
     var loader = new SqlLoader();
     loader.AddDatabaseEngine("(localdb)\\v11.0");
     loader.AddScript("instawltdb.sql");
     loader.AddScriptArgument("SqlSamplesDatabasePath", dbPath);
     loader.AddScriptArgument("SqlSamplesSourceDataPath", dbPath);
     loader.Execute(dbPath);
 }
コード例 #2
0
        public static void ResetDataSource()
        {
            var dbPath = SqlLoader.GetDatabaseDirectory("AdventureWorks_2012_LT_Script");
            var loader = new SqlLoader();

            loader.AddDatabaseEngine("(localdb)\\v11.0");
            loader.AddScript("instawltdb.sql");
            loader.AddScriptArgument("SqlSamplesDatabasePath", dbPath);
            loader.AddScriptArgument("SqlSamplesSourceDataPath", dbPath);
            loader.Execute(dbPath);
        }
コード例 #3
0
        public static void ResetDataSource()
        {
            // This is a folder in  App_Data folder
            var dbPath = SqlLoader.GetDatabaseDirectory("AdventureWorks_2012_LT_Script");
            var loader = new SqlLoader();
            loader.SetDatabaseEngine("(localdb)\\MSSQLLocalDB");

            // It is in folder App_Data/AdventureWorks_2012_LT_Script folder
            loader.AddScript("instawltdb.sql");
            loader.AddScriptArgument("SqlSamplesDatabasePath", dbPath);
            loader.AddScriptArgument("SqlSamplesSourceDataPath", dbPath);
            loader.Execute(dbPath);
        }
コード例 #4
0
        public static void ResetDataSource()
        {
            // This is a folder in  App_Data folder
            var dbPath = SqlLoader.GetDatabaseDirectory("AdventureWorks_2012_LT_Script");
            var loader = new SqlLoader();

            loader.SetDatabaseEngine("(localdb)\\MSSQLLocalDB");

            // It is in folder App_Data/AdventureWorks_2012_LT_Script folder
            loader.AddScript("instawltdb.sql");
            loader.AddScriptArgument("SqlSamplesDatabasePath", dbPath);
            loader.AddScriptArgument("SqlSamplesSourceDataPath", dbPath);
            loader.Execute(dbPath);
        }