コード例 #1
0
        public SqlBatchExecution ExecuteSqlBatch(ISqlBatch sqlBatch)
        {
            SqlBatchExecution execution = new SqlBatchExecution();

            using (SqlConnection dbConnection = new SqlConnection(_connectionString))
                using (SqlCommand dbSqlCommand = new SqlCommand(sqlBatch.Sql, dbConnection))
                {
                    dbSqlCommand.CommandType = CommandType.Text;
                    dbConnection.Open();

                    try
                    {
                        dbSqlCommand.ExecuteNonQuery();
                    }
                    catch (SqlException ex)
                    {
                        execution.Exception = ex;
                    }

                    dbConnection.Close();
                }

            sqlBatch.Executions.Add(execution);

            return(execution);
        }
コード例 #2
0
        public SqlBatchExecution ExecuteSqlBatch(ISqlBatch sqlBatch)
        {
            SqlBatchExecution execution = new SqlBatchExecution();

            using (SqlConnection dbConnection = new SqlConnection(_connectionString))
            using (SqlCommand dbSqlCommand = new SqlCommand(sqlBatch.Sql, dbConnection))
            {
                dbSqlCommand.CommandType = CommandType.Text;
                dbConnection.Open();

                try
                {
                    dbSqlCommand.ExecuteNonQuery();
                }
                catch (SqlException ex)
                {
                    execution.Exception = ex;
                }

                dbConnection.Close();
            }

            sqlBatch.Executions.Add(execution);

            return execution;
        }
コード例 #3
0
ファイル: TestDatabase.cs プロジェクト: radtek/DB-Unicorn
 public virtual SqlBatchExecution ExecuteSqlBatch(ISqlBatch sqlBatch)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public virtual SqlBatchExecution ExecuteSqlBatch(ISqlBatch sqlBatch)
 {
     throw new NotImplementedException();
 }