If you are building asynchronous custom components for SSIS then at some point you will need to use the various Set*() methods of the PipelineBuffer class to populate data into the output buffer. There are a lot of these set methods but the documentation is pretty lax about which you should use depending on the DataType of the column that you are populating. Hence, I thought I'd try and provide a definitive mapping list.
Here is the same information presented slightly differently so you can see which methods are used for more than one datatype.
[Note that when I authored this blog entry in Live Writer all the gridlines in the above tables were visible. Someone has configured our blog server not to display them. I know not why, answers on a postcard!]
Note also that SetNull() can be used on any non-BLOB columns to insert a null value. The BLOB datatypes are DT_TEXT, DT_NTEXT and DT_IMAGE.
The eagle-eyed amongst you will notice that some data types are not covered in the above list; DT_DBTIME, DT_DBDATE and DT_FILETIME are all missing. The reason is that there are no Set*() methods that support those types. For DT_DBDATE and DT_FILETIME however you can simply set the column to an object that is of the correct type (i.e. DateTime). The object is internally cast to the correct type however be aware that you must pass the correct type (of course) hence this is NOT type safe. For DT_DBTIME the story gets even worse in SSIS2005, there is simply no support at all for populating DT_DBTIME columns from managed code. I'm reliably informed that there is a new SetTime() method in SSIS2008 that will support this.
If I can be bothered to piece together some sample code from my inelegant efforts I might post it up here soon. Watch this space.
Thanks to Michael Entin for all his help in furnishing me with the information for this blog entry.
-Jamie