SSIS



  • I'm writing a custom data flow source component for SSIS 2012, and the requirement arose to write a custom GUI for configuring the component. The GUI needs connection information (specifically, two different connections). Of course, for a newly-added component, the connections are not yet set, so adding and/or creating them is part of the user interface.

    I was having all kinds of problems, though, getting the component to save the connections. I found no good examples on MSDN or elsewhere. The SSIS API makes it appear that something like the following should work:

    public class WtfUI : IDtsComponentUI
    {
        // Set in Initialize method:
        private IDTSComponentMetaData100 _componentMetaData;

        // ...

        public bool Edit(IWin32Window parentWindow, Variables variables, Connections connection)
        {
            // Set some stuff up, then:
            var dialogResult = MainForm.ShowDialog(parentWindow);

            if (dialogResult == DialogResult.OK)
            {
                _componentMetaData.RuntimeConnectionCollection.GetRuntimeConnectionByName("First Connection").ConnectionManager =
                    DtsConvert.GetExtendedInterface(selectedFirstConnection);
            }
        }
    }

    It doesn't. I tried several different ideas. Google found EzAPI, which is supposed to simplify the SSIS interface. A little late to use it (and, for a variety of reasons, I probably can't), but I thought I'd check for its solution. Said solution boils down to:

                _componentMetaData.RuntimeConnectionCollection.GetRuntimeConnectionByName("First Connection").ConnectionManagerID = selectedFirstConnection.ID;
                _componentMetaData.RuntimeConnectionCollection.GetRuntimeConnectionByName("First Connection").ConnectionManager =
                    DtsConvert.GetExtendedInterface(selectedFirstConnection);

    So, I have to specify the connection ID, then specify the connection, from which you could have gotten the ID yourself? Brillant, Microsoft. And, yes, this change solved the problem.



  • @corgimonster said:

    I'm writing a custom data flow source component for SSIS 2012

    I've been using SSIS and its older brother DTS for over 10 years, to move all kinds of data and do all kinds of crazy shit. CDI, geo data, binary conversion, xml voodoo. I never had to write a custom pipeline component and every time I've heard of someone writing one I knew it would go downhill fast...


    @corgimonster said:

    and the requirement arose to write a custom GUI for configuring the component.

    ... so it begins.



  • So this isn't a spectate swamp integrated search thread? I am disappoint.



  • @Zemm said:

    So this isn't a spectate swamp integrated search thread? I am disappoint.
    Yeah I know, my brain keeps replacing the I with a D whenever I read through the thread list.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.