Wednesday, March 28, 2012

Saving Packages and Custom Component data

I am looking for some advice regarding saving custom component data when saving packages.

For custom "properties", this is not an issue, as saving the package will save these properties. Howver, I also have information for each column (besides the properties that columns provides, like Name and DataType) that I need to save if a package were to be saved, and right now it does not save because I am using my own objects to store the data.

I am wondering as to how I can save this information. I have looked up on serialization, but I would like to know if there is another way besides serialization to save this inforamtion as I'd rather not save this to a seperate file.

ThanksI think I found another method, and this method would make more sense...

There is a topic in msdn about persisting custom objects and implementing SaveToXml and LoadFromXml methods. The only problem is that this topic is vague and not very helpful for me in determing how to use this. If anybody can point me to some good documentation, or that could explain it here that would be greatly appreciated.

I have my own class, and I created my own custom object. I have many instances of this object stored currently in a Hashtable. I want to be able to save this.

Thanks|||Search Books Online for "Persisting Custom Objects" (under SSIS). You will either have to implement ISerializable, or write your own routines to save your custom objects as XML.|||Thanks for your reply.

I actually stumbled on a different solution that I have tested and works great.

Because the data that I wanted to save was for each output column, I created custom properties in the IDTSOutputColumn90.CustomPropertyCollection

These custom properties are automatically saved in the XML for you.

Considering that I've been working with custom properties for the actual component I was a little surprise that I did not pick up on creating custom properties for output columns earlier.

No comments:

Post a Comment