Click here to Skip to main content
15,896,398 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 124.6K   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;
#endregion

namespace ImportLib.Supports
{
    /// <summary>
    ///     Constans some utility methods
    /// </summary>
    public class Utility
    {
        /// <summary>
        ///     Convert a string into the Hexadecimal representation and then encode
        /// it for xml complaince
        /// </summary>
        /// <param name="originalValue">The original value</param>
        /// <returns>Formatted value</returns>
        public static string ToXmlComplaintHexString(string originalValue)
        {
            char[] characters = originalValue.ToCharArray();
            StringBuilder formattedValue = new StringBuilder();
            foreach (char ch in characters)
            {
                Byte bt = Convert.ToByte(ch);
                string xmlComplaint = string.Format("_x{0}_", bt.ToString("X2").PadLeft(4,'0'));
                formattedValue.Append(xmlComplaint);
            }
            return formattedValue.ToString();
        }
    }
}

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