diff options
Diffstat (limited to 'product/application/data/SqlDatabaseCommand.cs')
| -rw-r--r-- | product/application/data/SqlDatabaseCommand.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/product/application/data/SqlDatabaseCommand.cs b/product/application/data/SqlDatabaseCommand.cs index b7dbd48..8654f30 100644 --- a/product/application/data/SqlDatabaseCommand.cs +++ b/product/application/data/SqlDatabaseCommand.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Data; @@ -11,11 +10,22 @@ namespace gorilla.migrations.data public SqlDatabaseCommand(IDbConnection connection) { this.connection = connection; + this.connection.Open(); } public IEnumerable<DataRow> run(string sql) { - throw new NotImplementedException(); + var table = new DataTable(); + using (var command = connection.CreateCommand()) + { + command.CommandText = sql; + command.CommandType = CommandType.Text; + table.Load( command.ExecuteReader()); + } + foreach (DataRow row in table.Rows) + { + yield return row; + } } public void run(SqlFile sql) @@ -34,4 +44,4 @@ namespace gorilla.migrations.data connection.Dispose(); } } -}
\ No newline at end of file +} |
