Click here to Skip to main content
15,886,873 members
Articles / Database Development / SQL Server

Importing data with the SSIS Object model

Rate me:
Please Sign up or sign in to vote.
3.74/5 (8 votes)
25 Jun 2007CPOL6 min read 124K   1K   47  
Describes how to use the SSIS object model for importing data to SQL server 2005
#region Copyright notice
//===================================================================================
//
//===================================================================================
#endregion

#region Using Directives
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
#endregion

namespace ImportLib
{
    /// <summary>
    ///     Encapsulates the result of a package execution
    /// </summary>
    public class ExecutionResult
    {
        private ExecResult result;

        /// <summary>
        /// Get the Execution Result
        /// </summary>
        public ExecResult ExecResult
        {
            get { return result; }
        }

        private ExecutionError[] errors;

        /// <summary>
        /// Get the Errors
        /// </summary>
        public ExecutionError[] Errors
        {
            get { return errors; }
        }
	
        /// <summary>
        /// Creates a new instance
        /// </summary>
        internal ExecutionResult() : this( ExecResult.Success,new ExecutionError[]{})
        {
            // Nothing TODO
        }

        /// <summary>
        /// Creates a new instance
        /// </summary>
        /// <param name="result">
        ///     The <see cref="T:ImportLib.ExecResult"/>.
        /// </param>
        /// <param name="errors">
        ///     An array of <see cref="T:ImportLib.ExecutionError"/> objects.
        /// </param>
        internal ExecutionResult(ExecResult result, ExecutionError[] errors)
        {
            this.result = result;
            this.errors = errors;
        }
    }

    /// <summary>
    /// The Execution result values
    /// </summary>
    public enum ExecResult
    {
        /// <summary>
        /// The execution was successful
        /// </summary>
        Success,

        /// <summary>
        /// The execution was unsuccessful
        /// </summary>
        Failed,

        /// <summary>
        /// Completion
        /// </summary>
        Completion,

        /// <summary>
        /// Cancelled
        /// </summary>
        Cancelled
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Netherlands Netherlands
Engineer Powered by the Cloud

Comments and Discussions