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(); } } } }
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(); } } } }