Exemplo n.º 1
0
 public void execute_file()
 {
     var connection_string = "server=devsql01; uid=schools2; pwd=schools_1; database=ese";
     var file_path = @"c:\code\github\roy\roy.tests\examples\1 one.sql";
     var script = new sql_script(connection_string);
     script.execute(file_path);
 }
Exemplo n.º 2
0
Arquivo: q.cs Projeto: soccerazy/roy
 public void execute_files(string directory)
 {
     var file_paths = Directory.GetFiles(directory);
     var sql_files = new List<FileInfo>();
     foreach (var file_path in file_paths) {
     var file = new FileInfo(file_path);
     if (file.Extension == "sql") {
         sql_files.Add(file);
     }
     }
     sql_files = sql_files.OrderBy(f => f.Name).ToList();
     var script = new sql_script(to);
     foreach (var sql_file in sql_files) {
     script.execute(sql_file.FullName);
     }
 }