예제 #1
0
        public void CreateStoredProcedures()
        {
            var provider = new SqlServer.SqlConnectionProvider();
            Trace.Write("Loaded provider " + provider.GetType().Name);

            using (var cn = new SqlConnection(Properties.Settings.Default.ConnectionString))
            {
                cn.Open();
                using (var cmd = cn.CreateCommand())
                {
                    foreach (var sql in Regex.Split(Properties.Resources.DatabaseReset, @"^\s*GO\s*$", RegexOptions.Multiline))
                    {
                        cmd.CommandText = sql;
                        cmd.ExecuteNonQuery();
                    }
                }
            }
        }
예제 #2
0
        public void CreateStoredProcedures()
        {
            var provider = new SqlServer.SqlConnectionProvider();

            Trace.Write("Loaded provider " + provider.GetType().Name);

            using (var cn = new SqlConnection(DatabaseHelper.ConnectionString))
            {
                cn.Open();
                using (var cmd = cn.CreateCommand())
                {
                    foreach (var sql in Regex.Split(Properties.Resources.DatabaseReset, @"^\s*GO\s*$", RegexOptions.Multiline))
                    {
                        cmd.CommandText = sql;
                        cmd.ExecuteNonQuery();
                    }
                }
            }
        }
예제 #3
0
 public static void Reset()
 {
     try
     {
         var provider = new SqlServer.SqlConnectionProvider();
         using (var cn = new SqlConnection(ConnectionString))
         {
             cn.Open();
             using (var cmd = cn.CreateCommand())
             {
                 cmd.CommandText = "TestReset";
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.ExecuteNonQuery();
             }
         }
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.ToString());
         throw;
     }
 }
예제 #4
0
 public static void Reset()
 {
     try
     {
         var provider = new SqlServer.SqlConnectionProvider();
         using (var cn = new SqlConnection(ConnectionString))
         {
             cn.Open();
             using (var cmd = cn.CreateCommand())
             {
                 cmd.CommandText = "TestReset";
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.ExecuteNonQuery();
             }
         }
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.ToString());
         throw;
     }
 }